Empty while condition doesn't work

0 votes
asked Feb 9, 2017 in Bug by mnlipp (240 points)
I'm considering to use PlantUML. One thing I have stumbled across is the strange use of diamond shapes in the activity diagram. I don't know if it is really UML compliant to write a question in the diamond shape -- at least I don't know of any other tool that does it. And I certainly don't like it.

I found, however, that I can get the commonly used diagrams by using empty conditions and labels with square brackets. But there is one exception:

start

 while () is ([cond met])
   :Do it;
 endwhile ([else])

end
 

doesn't work. I have to put at least one space between the braces after "while" (which ruins the diamond shape).

As it is possible to use an empty conditions in "if () then ([cond met])" and "repeat while () is ([cond met])" I think this is a bug.

1 Answer

0 votes
answered Feb 9, 2017 by plantuml (295,000 points)
selected Feb 9, 2017 by mnlipp
 
Best answer

Yes, it is indeed not very consistent.

So here is a beta that fix the while() issue:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

About writing a question in the diamond shape, your question looks similar to http://plantuml.sourceforge.net/qa/?qa=5335/activity-beta-conditional-user-input-or-check

If you can provide us some drawing example from other tools on how they display questions (so not it diamond shape), we would be glad to considere enhancing PlantUML.

Finally, there is a not-very-documented setting that allows to display differently diamond shape:

@startuml
skinparam conditionStyle diamond
start
while (ITERATE consolidatedYears) is ([next <b>consolidatedYear</b>])
  if (revision code in year?) then ([no])
    :action;
    if (test) then (yes)
    else
    endif
  else
  endif
endwhile
end
@enduml


I don't know if it's what you are looking for.

commented Feb 9, 2017 by mnlipp (240 points)
Thanks! The "skinparam conditionStyle diamond" is a good workaround, because with this, the empty space in the braces after the while doesn't show.

IMHO UML doesn't have "questions" at all, so the question where to put them doesn't arise. All you have in UML is a decision node and two or more outgoing transitions with guard conditions (e.g. http://www.sparxsystems.com/resources/uml2_tutorial/uml2_activitydiagram.html or http://agilemodeling.com/style/activityDiagram.htm#DecisionPoints). The modelling tools that I know of (e.g. Together [my first], Papyrus, ArgoUML) don't allow you to specify something like "a question".
...