Formatting of repeat loops spread trough several swimlanes

0 votes
asked Apr 30, 2016 in Closed bug by marcobaldo (120 points)

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;


1 Answer

+1 vote
answered May 4, 2016 by plantuml (257,860 points)
selected May 6, 2016 by marcobaldo
Best answer
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 !
commented May 6, 2016 by marcobaldo (120 points)
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.
commented May 10, 2016 by plantuml (257,860 points)
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 ?
commented May 10, 2016 by anonymous
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.