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)
Hi,

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?

Thx

1 Answer

0 votes
answered Aug 4, 2016 by plantuml (294,960 points)

Which version of PlantUML are you using ?

The following example is working on the online server:

@startuml
start
if (foo) then (ok3)
elseif (foo2) then (ok2)
else (notok)
endif
@enduml

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

Thanks!

 

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 (294,960 points)
With last beta:

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

You can now have:

@startuml
start
if (foo) then (ok3)
:f1;
(additional text) elseif (foo2) then (ok2)
:f2;
else (notok)
:f3;
endif
@enduml

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!
...