Activity diagrams default yes and no for if, while, etc.

+2 votes
asked Nov 1, 2017 in Wanted features by Pander (780 points)
I use a lot of activity diagrams (beta) and for each conditional, repeat loop and while loop I use labels yes and no on the arrows. However, it will save me a lot of work and lines of code in PlantUML if this can be set automatically. Can a setting be introduced which enables 'yes' and 'no' labels on all arrows leaving conditionals?

The following examples would then give the same output:

if (blah?) then (yes)
  :blah blah;
else (no)
  :blah blah blah;
endif

show yesno
if (blah?)
  :blah blah;
else
  :blah blah blah;
endif

and:

if (blah?) then (yes)
  :blah blah;
else (no)
endif

show yesno
if (blah?)
  :blah blah;
endif

and:

if (blah?) then (yes)
  :blah blah;
elseif (blaaah?) then (yes)
  :blah blah blah;
else(no)
endif

show yesno
if (blah?)
  :blah blah;
elseif (blaaah?)
  :blah blah blah;
endif

and:
while (blah?) is (yes)
  :blah blah blah;
endwhile (no)
show yesno
while (blah?)
  :blah blah blah;
endwhile

1 Answer

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

You may use macros to simplify things.

Example:

!define IF(s) if (s) then (yes)
!define ELSE else (no)

     
if (blah?) then (yes)
  :blah blah;
else (no)
  :blah blah blah;
endif

IF(blah?)
  :blah blah;
ELSE
  :blah blah blah;
endif

...