Could you add a "goto" feature to activity beta?

+6 votes
asked Sep 18, 2015 in Wanted features by anonymous
retagged Sep 18, 2015 by plantuml
It would be nice to be able to make a jump into any activity diagram activity, especially when trying to visualize the behaviour of old Fortran codes that do not conform to the usual conventions of structural programming.

This could be easiest accomplished with a label and a "goto" command.

1 Answer

0 votes
answered Sep 18, 2015 by plantuml (279,680 points)

Goto is really one on the most asked feature. (See )

As said in it's very difficult to implement some goto feature with the current architecture, because the whole drawing is done with some recursive algorithm, and the goto completely breaks this.

Anyway, we have started to implement an alpha version of goto. It's been working for a while. You can try:

label lab1
if (some test) then
  goto lab1

Unfortunatly, the drawing is not very good, and it works only with goto going backwards.
Anyway, we are still very interesed with real world examples, so you can translate your old Fortran code to this syntax and send it to us.
It will help us to define a consistent architecture for supporting goto.


commented Dec 4, 2015 by anonymous
Hi, the alpha version would be very useful if:

1) the goto line inherited the correct skinparam formatting and
2) The detach command was permitted after both the label and the goto commands (as otherwise the original route continues to an expected end block)

commented Jun 13, 2017 by sveinburne (100 points)
This is a good example (in french though). Since a goto use cases seems to always refer to a control block, one fix could be to allow us to write an explicit control block (diamond) which can be referenced with a goto.

example :

<> referenced_diamond
:Some action;


goto referenced_diamond

That would allow to either break and exit a loop, break and repeat a loop... But I don't know how easily it is feasible with the current implementation.
commented Sep 19 by Mark
Hi, I am very happy with the goto-feature added to activity beta. In real-life process mapping, I face very often "nested branching". With [if then] and [label goto] I can match this.
But unfortunatelyv, together with swimlanes the goto-connection is not drawn.
Is there any possibility, to implement [label goto] together with swimlanes?