Rendering errors when nesting multiple repeat-while blocks

0 votes
asked Sep 4 in Bug by lajcik (120 points)

I've noticed weird rendering errors when nesting repeat statements inside swimlanes:

When you put a nested repeat statement inside a single swimlane the diagram is broken:

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuQh9ISnBLJ2iuGABS1Mb5gGcmYW5g-Byt5I5nEIIpFmyQvXWUKPcJgf6IMfnYOAX9ZPH8w1eSKb-0PT3QbuAq0u0

Example with two swimlanes where the 2nd statement is in 2nd swimlane:

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuQh9ISnBLJ2iuGABS1Mb5gGcmYW5BglY_DnKXSJaaipyF6kOQ7b6PawgHabgSOc2eQOrr0IZ6YpIHa3fufBy0Yw7rBmKe6q0

The only way to get the diagram to render correctly is to insert a dummy node as such:

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuQh9ISnBLJ2iuGABS1Mb5gGcmYW5BglY_DnKXSJaaipyF6kOQ7b6PawgHabgSOc2eQOrr0IZ6YwhbDBSt4g5lFoKL6ngZO1gYqlo2xWSKlE0AdC0

All of this works perfectly when I don't use swimlanes at all like so: :)

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuG8pk8fI2r8JOPI2LN5-Rgf2Od99PdwUDKomF2Cp9rMZ9BMuHC5G4vke4L2qk2I_WCiXDIy5Q3G0

Some context: I'm making an activity diagram using swimlanes to illustrate who performs an action. I'll probably switch to using colors so I can work around this :)

commented Sep 5 by albert (2,940 points)

Not sure but in the non swimline version you jump back onto the "some action", shouldn't you jump to a "diamond" on top of it? According to the documentation (https://plantuml.com/activity-diagram-beta) it is OK to do it like you do it) This can be accomplished by means of writing the ": some action" on the next line like:

@startuml
start
repeat
repeat
:some action;
repeat while(test 1);
repeat while(test 2);
stop
@enduml

That said, the version with the swimlane looks in that case OK as well:

@startuml
|lane 1|
start
repeat
repeat
:some action;
repeat while(test 1);
repeat while(test 2);
stop
@enduml

But seen the previous mentioned documentation, I think there is a bug for this in the swimlane version and my solution is just a workaround.

commented Sep 7 by lajcik (120 points)

Yup, I did that on purpose to demonstrate how the swimlanes cause that particular example to break.

My use case is that I want to highlight roles that are responsible for carrying out specific actions on the activity diagram. 

Initially i wanted to use swimlanes to represent that, but inserting dummy nodes to fix rendering issues makes it a bit of a no no. 

I tried to use colors for this but I can't find a way to color the 'repeat while' diamond differently from the 'repeat' diamond. I can either assign the same color to both:

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuG8pk9I3KbEiYb8BKXDBkAoAytDJIp8oyzAjkI122kKPcJcf6YMfnIMQra0T-GLS3gbvAK3j0000

Or only the first  diamond if i combine both on the same line: `repeat :label`

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuG8pk9I3KbEiYb8BKXDB5AoAytDJIp8oyzAjkQ12vHcPEQaQ9Qd59PhMG1tv1LmEgNafGEq0

Grouping does not work either since `partition` cannot break a repeat 

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuG8pk0g0H6P9PdwUWb9mIOQIGZMNSb1gYbLHQa5gOec2LN5-Rcf9HcPUkZLNBHTKi3mZCoTLeoIrk4JJ6cXAVW6NGsfU2j180000

I'm running out of ideas... :|

1 Answer

0 votes
answered Sep 18 by plantuml (232,640 points)
Thanks for the report.

This is fixed in last beta http://beta.plantuml.net/plantuml.jar

Tell us if it's not working for you !
...