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

0 votes
asked Jan 13, 2015 by anonymous
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?

1 Answer

+1 vote
answered Jan 13, 2015 by pacheco (590 points)
edited Jan 14, 2015 by pacheco

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:

 

commented Jan 14, 2015 by muteboy (110 points)
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?
commented Jan 14, 2015 by plantuml (134,510 points)
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!
commented Jan 14, 2015 by muteboy (110 points)
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;'?
commented Jan 14, 2015 by pacheco (590 points)
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
commented Jan 14, 2015 by plantuml (134,510 points)
Yet another bug...

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

Thanks for reporting!
commented Jan 14, 2015 by pacheco (590 points)
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
commented Jan 14, 2015 by plantuml (134,510 points)
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?
commented Jan 14, 2015 by pacheco (590 points)
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).
commented Jan 15, 2015 by plantuml (134,510 points)
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!
commented Jan 15, 2015 by pacheco (590 points)
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
...