Activity beta --- Any way to put a text on arrow going to 'elseif' node?

+1 vote
asked Aug 4, 2016 in Wanted features by ivokrab (160 points)

With the new activity syntax, the arrow representing the 'false' branch of an 'if'-construct can always get a text by putting an 'else (text-on-arrow)', even if that branch is left empty.

However, if an 'elseif' follows an 'if', that is not possible. Is there any way to put a text on the arrow going from the 'if'-node to the 'elseif'-node?


1 Answer

0 votes
answered Aug 4, 2016 by plantuml (257,860 points)

Which version of PlantUML are you using ?

The following example is working on the online server:

if (foo) then (ok3)
elseif (foo2) then (ok2)
else (notok)

But maybe we did catch the real bug. Please provide a simple non-working example if this is the case.



commented Aug 8, 2016 by ivokrab (160 points)
I am using the online server. Have not gotten around to installing PlantUML locally.

My question was: in your example, how do I get a text on the arrow going from 'foo' to 'foo2' (which represents the 'else'-path to the first condition)? It is not so much a bug as a shortcoming in the grammar, maybe. I could of course just nest another 'if' in the 'else'-clause of the first one, but then I lose the specific layout with parallel paths that the 'elseif's generate...

Actually, in the current situation, the structure represents more a 'case'-statement, with multiple options being checked for the same variable, rather than a real 'if'-'elseif', where the second decision can use a completely different criterion.
commented Sep 9, 2016 by plantuml (257,860 points)
With last beta:

You can now have:

if (foo) then (ok3)
(additional text) elseif (foo2) then (ok2)
else (notok)

Is this what you are expecting ?
commented Oct 4, 2016 by anonymous
Thanks a lot, this is what I was looking for.

I just suggest to position the label to the start of the arrow. I mean, in this example, the "additional text" label would be better if positioned like the "notok" label.

Congratulations for the work!