Switch or multiple else branches for new activity diagram

+2 votes
asked Jun 5, 2013 in To be sorted by anonymous
Is there a way to achieve something like

@startuml
if (Condition) then (default)
...
else (case 1)
...
else (case 2)
...
else (case 3)
...
endif
@enduml

Trying it like this does not work unfortunately, the case 1 and 2 are just replaced by case 3.

1 Answer

0 votes
answered Jun 20, 2014 by plantuml (160,740 points)

Hi,

You can have this:

@startuml
start
if (condition A) then (yes)
  :Text 1;
elseif (condition B) then (yes)
  :Text 2;
  stop
elseif (condition C) then (yes)
  :Text 3;
elseif (condition D) then (yes)
  :Text 4;
else (nothing)
  :Text else;
endif
stop
@enduml

Sorry we did not document that before!

...