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.

Represent if/then or while loop over swimlanes to show a document review process

0 votes
I have just discovered PlantUML, and having used GraphViz for some time, I love how it can generate excellent diagrams. I want to produce something specific, and I need help to figure out the syntax.

The process is as follows: A document review process. I would like to use swimlanes, but if an sequence diagram would work better, let me know.

Here's the process I want to show. I can't get it to show up correctly in swimlanes.

Author writes document, submits to Reviewer. They are in seperate swimlanes.

Reviewer reviews. If it's accepted, they pass it to someone else.

If it's not accepted, it goes back to the Author for editing and resubmission.

The review cycle will repeat until the Reviewer accepts the document.

How would you represent that?
asked Jan 13, 2015 by anonymous

1 Answer

+1 vote

Actually there is a bug in PlantUml trying to do that...

 

Anyway, it would be something like:

 

|Architect|
start
repeat
:Write;
|#AntiqueWhite|Reviewer|
:Reviews;
|Architect|
repeat while (was it proper?)
->yes;
|(...)|
:some action on the next level;
stop

 

Note that the arrow from "Reviews" to "was it proper" is missing due to the bug...

 

If you try a repeat within the same swimlane it works:

 

======== EDIT =========

 

It was fixed in the version on the comment:

 

answered Jan 13, 2015 by pacheco (590 points)
edited Jan 14, 2015 by pacheco
I'm the OP. Thank you for the answer, it seems that would be exactly what I want. It's a shame about the bug. Is it likely to be fixed any time soon?
Thanks for the report.

It has been solved in the new beta:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Somehow, this kind of bugs may exist with swimlanes.
They are easy to fix, but it's difficult to test and detect them, so we are counting on users to report them :-)

Thanks again!
That's great! Thank you very much.
Next question. Is there a way to get labels "yes" and "no" coming out of "was it proper?"?
Also, what is the purpose of '->yes;'?
the "-> yes;" was meant to have the "yes" tag in the exit arrow.
But it is not working. it needs to be reported as well
Yet another bug...

This is fixed in this (yet) another beta:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Thanks for reporting!
yes, that seems fixed now...
However, there are still some errors:
-----------------
start
-> started;
repeat
-> no;
:Write;
-> send to review;
:Reviews;
-> endrepeat;
repeat while (was it proper?)
->yes;
:some action;
stop
----------------------

* "started" text appears as "no"
* "no" text doesn't appear if you remove the "started" text!
* "no" text should be in the arrow going up
* "endrepeat" text is not shown
We've just published yet new beta that fixes the "->yes" issue:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

About "->no" there is indeed a bug.
But we think that we should slightly change the syntax to have something more logical.

What do you think about ?

@startuml
start
-> started;
repeat
:Write;
-> send to review;
:Reviews;
-> endrepeat;
repeat while (was it proper?) -> no;
->yes;
:some action;
stop
@enduml

Notice that the "->no" has been moved
Any though?
yes sounds ok.
Like that, the "->" syntax always refers to the last arrow; and as the repeat has 2 arrows, this way it seems a good compromise.

This might need a bit of documentation, as it is not as straight forward as the other ones.

Also, please make sure we can add text in the arrow between the "repeat" keyword and the first activity inside the loop (":write;" in this case).
This has been fixed in the last beta
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

We have tested :
@startuml
start
-[#green]-> before repeat;
repeat
-[#pink]-> after repeat;
:Write;
-> send to review;
:Reviews;
-[#yellow]-> endrepeat;
repeat while (was it proper?) -[#blue]-> no
-[#red]->yes;
:some action;
stop
@enduml

Thanks again for your tests.
And do not hesitate to post issues/ideas of improvements!
these examples look proper now :)
thank you very much

However, this report (arrows being double written -- wrong) is still not fixed:
http://plantuml.sourceforge.net/qa/?qa=2942/activity-beta-arraw-text-and-color-problems&show=2987#c2987
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...