new activity diagram syntax

0 votes
asked Oct 31, 2013 in Wanted features by anonymous
Hi

The new syntax for activity diagrams is very efficent and produce "easy to read" sources : a great feature !

Representing a "switch/case"  is not easy with the current syntax and could reduce the height of the resulting picture. It should be a really nice improvment.

Thank for you great job

1 Answer

0 votes
answered Nov 6, 2013 by plantuml (294,960 points)

Rather than adding a "switch/case" syntax, we propose to add a "else if" instruction. This should give the same result.

 @startuml
 start
 if (test1) then (ok1)
   :ins1 which is very very long;
 elseif (test2) then (ok2)
   :ins2 which is very very long;
 elseif (test3  which is very very long) then (ok3)
   :ins3;
 else (ok4)
   :ins4 which is very very long;
 endif
 :end of tests;
 @enduml

The proposed syntax has been implemented in the following alpha version

https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

The drawing is not perfect (yet), some arrows are missing between diamonds, some labels are not printed, but the general idea is here.

Any comment ?

 

 

...