How to redirect back arrow in `endwhile`

0 votes
asked May 17, 2022 in Question / help by mcon (320 points)

I have the following activity diagram;

@startuml
start
-> LRM consumer thread;
:Initialize LRM;
:Subscribe to SoundCommands channel;
repeat :Wait for incoming command;
    while (command available?) is (available)
        :Dispatch command;
    endwhile (no  more commands)
repeat while
@enduml

I would like to avoid the "long tour" of arrow going back ("no more commands") and short-circuit it on left or, at the very least, avoid the ugly vertical step under "Dispatch command"

Is it possible?

If so: how?

Many Thanks in Advance.

1 Answer

0 votes
answered May 23, 2022 by Chris Trail
selected May 24, 2022 by mcon
 
Best answer

Will this work?

@startuml
start
-> LRM consumer thread;
:Initialize LRM;
:Subscribe to SoundCommands channel;
While (Wait for incoming command);
    while (command available?) is (available)
        :Dispatch command;
    endwhile (no  more commands)
endwhile 
-[hidden]->
detach
@enduml

...