How to end a loop in the sequence diagram?

0 votes
asked Aug 3, 2023 in Question / help by Taka8Rie (140 points)
Hi,

I used the loop to recycle in the sequence diagram, but I would like to end this loop and start to send a new message to other participants. I have no idea to do it. If someone knew this method, please answer my question.

e.g.

@startuml

participant A

participant B

A -> B: start a loop

loop

      alt condition1

           "Here I want to end the loop

     else condition2

           B -> B: some messages

      end

end

@enduml

Thank you!

1 Answer

0 votes
answered Aug 3, 2023 by egr
edited Aug 3, 2023

Taka8Rie:

@startuml
participant A
participant B
A -> B: start a loop
loop <condition 1>
    alt condition2
           B -> B: some messages
    end
end
@enduml

The risk is that you have an infinite loop

Regards

...