In PlantUML adding activation lines in a sequence diagram can be very messy. Is there any way to make it auto activate and deactivate without all the extra text?
e.g.
Generate Sequence diagram without activation lines
@startuml
First -> Second
Second -> Third
Third -> Second
Second -> First
@enduml
But to add the activation lines its gets quite messy
@startuml
First -> Second : message
activate First
activate Second
Second -> Third: message
activate Third
Third -> Second: response
deactivate Third
Second -> First: response
deactivate First
deactivate Second
@enduml
I'm wondering if there is its possible to have it auto detect the likely create destroy points automatically
Yes (2017) with autoactivate on; the syntax is still in incubation, however it has been part of the distribution for some time.
Note that in all cases you still need to manually activate the First one, because there's no incoming message.
If you want to maintain control of the (de)activation, you can express activation/deactivation with ++
and --
symbols on the same line to activate the target.
activate First
First -> Second ++ : message12
Second -> Third ++ : message23
Third -> Second -- : response32
Second -> First -- : response21
deactivate First
With your original description you will quickly find out that you need to describe your lines properly as a return, otherwise you'll be activating ad nauseam.
autoactivate on
activate First
First -> Second
Second -> Third
Third --> Second
Second --> First
deactivate First
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With