Is it possible to make interlacing conditionals in activity diagrams?

0 votes
asked Apr 24, 2019 in Question / help by oehme (120 points)

I want to generate an activity diagram similar to the following, but with the "yes" branch of the second conditional "y?" pointing directly at the step "E". I was unable to produce this effect. Is this possible somehow?

The code:

@startuml
if (x?) then (no)
:A;
->
if (y?) then (no)
:C;
else (yes)
endif
else (yes)
:B;
endif
->
:D;
:E;
@enduml

For completeness here all the paths I want to display:

x true (y whatever): B D E

x false, y false: A C D E

x false, y true: A E

1 Answer

0 votes
answered Apr 25, 2019 by zoom
selected Apr 26, 2019 by oehme
 
Best answer

I think you have to use a connector:

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuSfCKz2eiDTKACb8pLFGoClNvB9ojERIjGDBLA9AE5jpfUOKfmB5KuirGMeq33MvKb9B4fCpk5BpKZBJaAMjdAmXWY25LYxMOCLMhjPS3a1HeCq0

@startuml
if (x?) then (no)
:A;
->
if (y?) then (no)
:C;
else (yes)
->
(1)
detach
endif
else (yes)
:B;
endif
->
:D;
(1)
:E;
@enduml

commented Apr 26, 2019 by oehme (120 points)
Ah, that certainly helps. Thanks a lot.

It would be nice to have a real line there, but this gets the meaning across too.
commented Apr 26, 2019 by Joe
I too would prefer that the line from (1) in the IF went directly to the (1) below.   The arrow should go LEFT and then DOWN.   Having the additional  reference inside the diagram to the connector is somewhat misleading.   Easier to view if the  yes (1) went LEFT and then down.
...