Is there a way to refer to an existing Activity inside a ActivityDiagram (goto)

+4 votes
asked Feb 20, 2014 in Wanted features by micatom (160 points)
retagged Sep 18, 2015 by plantuml
Hello guys,

I just wanted to know if there is a way to refer from an outgoing action of an Activity to another alreay existing Activity (like a goto feature)

If not is it planned to be ?

Thx,

Michaƫl.

--

 

@startuml

start

:User Data Form << View >>;
if (email exists) then (yes)
 goto :User Data Form << View >>;
else
 :User Presentation Form << View >>;
endif

stop

@enduml

2 Answers

+2 votes
answered Mar 6, 2014 by arnaud.bourree (200 points)

Hello,

I'm not specially for goto keywork but, I personaly need possibility to simplify Activity2 like:

@startuml
start
if (condition1?) then (yes)
  :action1;
  if (condition2?) then (yes)
    :action2;
  else
    :actionKO;
  endif
else (no)
  :actionKO;
endif
@enduml

from 2 action KO to something like only one action KO

Regards,

Arnaud

+3 votes
answered Aug 24, 2014 by plantuml (132,110 points)

Goto is one of the most asked feature, so we have decided to give a try.
The real issue with goto is that it is breaking the execution flow, and this is completely incompatible
with the way Activity Diagram are drawn.

However, nothing is ever impossible to do...

So starting with V8004, we have implemented a pre-alpha goto feature.
You can now use label/goto keywords to use goto feature:

:foo1;
label lab1
:foo2;
if (some test) then
  :foo3;
  goto lab1
else
  :foo4;
endif
stop


http://www.plantuml.com/plantuml/png/BOf12e0m30JlUKMEUgnwQbwZkDL2R8Ja_rZHopBCR2vcIKZN3Sfz4-Lk9g5QU72xm06FaUD48-OtpjBXiB3l3tNyPH52ssiX3xiV

However, again, this is only pre-alpha software : the drawing is ugly (line in green), goto are only working backwards,
this is not working with swimlanes...

We need users help for two things:
1) We want to validate that everyone is ok with the syntax
2) More important, we are very interested by real diagrams from end users : this will indeed help us to build the design
of the solution for goto. So please either publish here (or send us by mail) the text diagram you wanted to see working
(even if it's not working with the V8004 version). We are waiting for real diagrams, large enough to be realistic.

Thanks for you help!
 

commented Dec 3, 2014 by Jerome2606 (110 points)
edited Dec 3, 2014 by Jerome2606
something like the sample with menu choosen on http://msdn.microsoft.com/en-us/library/dd409465.aspx
And this is a diagram like we want to achieve with plantUML:
http://sce.uhcl.edu/helm/rationalunifiedprocess/process/modguide/md_bactdbom.htm
Finally here is a diagram from formation:
http://www.filedropper.com/slides-efficientbusinessanalysistrainingprogram-escent
commented Mar 10, 2015 by Jerome2606 (110 points)
Hello,

Is there any update for this most asked feature ?

Regards,
J
commented Jun 17, 2015 by anonymous
Hi,

I would need the goto to have the possibility to go back upwords if an error occurs

Is there anything I can help to improve the goto functionality?

Regards
commented Nov 24, 2016 by IanRogers (190 points)
General "goto" is always going to be a pain to implement and won't really reflect real code anyway... The "break" out of a loop(s) is much more useful.
...