Elseif arrow disappears when if does not continues

+1 vote
asked Feb 1, 2022 in Bug by Platte 1 flag

Hi there,

I currently have the problem, that the elseif arrow ends in the middle of nowhere, when the if section leads into a stop. You can find my example code below.

My simplified diagram looks like this:

Diagram as PNG

The code looks like this:

@startuml
skinparam ConditionEndStyle hline
!pragma useVerticalIf on
start
repeat
    if (option1) then (yes)
        stop
    elseif (option2) then (yes)
        :do something;
    endif
repeat while
@enduml


You can find it also on the online-server: https://www.plantuml.com/plantuml/uml/NSwnYiCm3CRnsNeAtPQCT-FT4ZWwT2vqDxKIYzgIiHHAthvfeHIwVlpvyKtciVjQ2zYLfSKUA_wh97PMEKWw-LO8Ss4X-6ezBZNYQdIcxdo9vJYZ2i0JWKwDeYC4dd7GzX2-H_HCWiD6Da88vjeWK35wDpyVpMzIDAtacMNvssj9FB_mM-P2CEtR_laE

If anyone knows how to avoid this, I would be very glad for a response. Thanks in advance!

2 Answers

0 votes
answered Mar 13, 2023 by Freakachoo

I have the same issue!

As I may see this is happening when `!pragma useVerticalIf on`

The code is:

@startuml
!pragma useVerticalIf on
start
if (condition A) then (yes)
  :Text 1;
  stop
elseif (condition B) then (yes)
  :Text 2;
else (nothing)
  :Text else;
endif
stop
@enduml

So the workaround is to use horizontal. But this is a bug.

0 votes
answered Mar 13, 2023 by Freakachoo (140 points)
Also this happens with `!pragma useVerticalIf on` and only if `stop` is in the first `if`. It works correctly if it is in a second `elseif` or in `else`.
commented Mar 15, 2023 by Platte
That's correct, that the error only occurs under these circumstances, but the order of if / elseif statements does change the logic and therefore is not arbitrary. Also for long diagrams a vertical diagram flow improves readability a lot and also fits a lot better to standard text flow.
...