Possible to draw a line to another box via id or label?

+1 vote
asked May 6, 2017 in Bug by tex (180 points)
 
Question, Is it possible to have a diagram where the 'then' block of an if statement, instead of defining its own content draws a line to a different location in the diagram? For example, In the following snippet, I do not want a box representing 'Four', but instead a want a line (for yes) going from 'CondB' to 'Two'. I do not know if this is possible, and if it is, how to express it?
 
Thank you for you attention.
 
@startuml
if (CondA?) then (yes)
  : One;
  : Two;
  : Three;
  else (no)
endif
if (CondB?) then (yes)
  : Four;
  else (no)
endif
stop
@enduml

1 Answer

+2 votes
answered May 6, 2017 by plantuml (235,460 points)
selected May 6, 2017 by tex
 
Best answer

Unfortunately no, you cannot do this.

You are looking for some kind of goto and this is difficult to implement.

However, we have started to implement some (limited) "break" feature, and maybe this could be useful for you:

Example:

@startuml
start
repeat
  :Test something;
    if (Something went wrong?) then (no)
      :OK;
      break
    endif
    ->NOK;
    :Alert "Error with long text";
repeat while (Something went wrong with long text?) is (yes)
->no;
:Alert "Sucess";
stop
@enduml

...