Named activate/deactivate

+3 votes
asked Jan 20, 2018 in Wanted features by rcmaniac25 (140 points)

I have a need to activate multiple times on an entity of a sequence diagram.

@startuml

title "Example"

entity A
entity B
entity C

A -> B
activate B
C -> B
activate B
B -> A
deactivate B
B -> C
deactivate B

@enduml

This causes a problem as the activations are a stack and shows up incorrectly. I'd like to be able to name them similar to the following:

@startuml

title "Example"

entity A
entity B
entity C

A -> B
activate B as AB
C -> B
activate B as CB
B -> A
deactivate AB
B -> C
deactivate CB

@enduml

This way I get the correct activation line.

commented Aug 16, 2021 by Peter
looking for same solution, that woul be great feature!

The current implementation is not usable to me, because the deactivate command deactivates ONLY the most recent activate. This is wrong. We need a kind of tagging of activated lines so we could deactivate a specific one.
commented Apr 27, 2023 by Christopher Da Silva
Nothing on this? This would be really helpful especially for async activations when activation can end while another process continues.

1 Answer

0 votes
answered Jan 25, 2018 by Anthony-Gaudino (5,720 points)

I didn't understand what you meant by "stack", if you meant that it creates a nested lifeline then you should not activate the the B again, because this creates a nested lifeline, so instead you should:

A -> B
activate B
C -> B
B -> A
B -> C
deactivate B
commented Jan 25, 2018 by rcmaniac25 (140 points)
By "stack" I mean "the activate/deactivate treats the nested lifelines in a first in, last out structure" which means that I can't nest lifelines (which I need/want for the graph I'm working on) because at the time I do a deactivate, the wrong lifeline gets deactivated.

My request is that the lifelines be nameable, so I can deactivate by name if needed.
commented Feb 28, 2018 by anonymous
Did you ever find a way to do this?
commented Mar 7, 2018 by rcmaniac25 (140 points)
I didn't figure anything out
...