Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

Formatting of repeat loops spread trough several swimlanes

0 votes

Is there any way of having the if condition of a repeat loop in the same swimlane as the preceding node, and not in the swimline where the loop was defined? This is my activity diagram, it looks a little bit strange:


if (New document?) then (yes)
else (no)
->Document Draft;
:Review Document;
repeat while (Document agreed?)
->Document Reviewed;
:Approve Document --> Update;
repeat while (Document approved?)
->Document Verified;
->Document Archived;
asked Apr 30, 2016 by marcobaldo (160 points)

1 Answer

+1 vote
Best answer
Thanks for the report.

This was more difficult to implement that we have initially though, but here is a beta version that should work with your example:


Tell us what if it's ok for you !
answered May 4, 2016 by plantuml (112,140 points)
selected May 6, 2016 by marcobaldo
It works, thank you!

If I can have now an additional question, as for the sake of clarity it would be really nice I could  have a yes/no indication near the if box of the if statement, i.e. (repeat loop taken for the on-line documentation)

repeat while (more data?) (yes, no)

Where yes and no are the optional text to be put near the if condition for a true and a false result.

And tnx again for your nice work.
This is not very documented (because we are not 100% satisfied by the syntax), but you can have:

  :read data;
  :generate diagrams;
repeat while (more data?) is (yes) not (no)


Is this what you are expecting ?
Yes, that's what I was looking for.

Maybe the syntax could be simply

repeat while (more data?, yes, no)


repeat while [([ifbox_text][,true_text][,false_text])]

And for the repeat statement i.e.

repeat (repeat loop starts here)


repeat [(repeat_initial_text)]

Repeat_initial_text is as on optional text be put inside the object at the beginning of the loop.

Tnx for your valuable work.
Support This Project Offer 250 Mo! Follow PlantUML on Twitter