Avoid multiple PlantUML backwards arrows

0 votes
asked Dec 22, 2025 in Question / help by bux (120 points)

The given activity schema :

@startuml
start
  while (Work to do?) is (found)
    if (Question 2 ?) then (yes)
      if (Question 3 ?) then (yes)
        if (Question 4 ?) then (yes)
          if (Question 5 ?) then (yes)
            :Success;
            break;
          else (no)
          endif
        else (no)
        endif
      else (no) 
      endif
    else (no)
    endif
  endwhile (no more)
end
@enduml
 

Produces this diagram:

screenshot

Is it possible to make all the "no" arrow to be one instead of these multiple squares?

1 Answer

0 votes
answered Dec 22, 2025 by The-Lu (86,860 points)

Hi B.,

From:

Currently that is not yet possible to merge all 'no' arrows: That is a wanted feature...

But here is a proposal with "label/goto" (but with one cross):

@startuml
start
  while (Work to do?) is (found)
    if (Question 2 ?) then (no)
    label sp;
    label lab;
    (yes ) elseif (Question 3 ?) then (no)
    label sp;
    goto lab;
    (yes ) elseif (Question 4 ?) then (no)
    label sp;
    goto lab;
    (yes ) elseif (Question 5 ?) then (no)
    label sp;
    goto lab;
    else (yes )
      :Success;
      label sp;
      label sp;
      label sp;
      break;
    endif
  endwhile (no more)
end
@enduml

If that can help,...

Regards,
Th.

commented Dec 23, 2025 by bux (120 points)
Thanks for this solution !
commented Dec 23, 2025 by The-Lu (86,860 points)

Hi B.,

You can also combine with: !pragma useVerticalIf on

Enjoy,

Regards,
Th.

...