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.

Proposal for fixing some layout deficiences

0 votes

I know that activity diagrams are difficult. But this comes out quite ridiculous:

@startuml receive-loop.svg
' ========== Receive loop =========
skinparam conditionStyle diamond
title Receive Loop
start
while ( ) is ([connection open])
  :Receive data;
  while ( ) is ([data in receive buffer])
    :Invoke decode;
    :Handle decoder result;
  endwhile ([else])
endwhile ([else])
end
@enduml

The problem with the outer loop is the placement of the "end". When an "end" or "stop" is used after "if" or "else", it is put next to the decision point. Whatever comes after the "endwhile" is actually equivalent to what comes after the "else" (of an "if"). So the placement of a "stop" or "end" after "endwhile" should be handled in a similar way.

The problem with the inner loop is the "snake" formed by the "else" transition. This could be avoided if there was some means to change the direction of the "[else]" transition that goes out of the decision point. It could e.g. be allowed to use "-right->" (in this case after the inner "endwhile") as in class diagrams.

asked Mar 2 by mnlipp (240 points)

1 Answer

0 votes
Thanks for your example.

Indeed, in that case (so a stop/end after the endwhile) the stop/end should be drawn just right to the [else] transition.

I think PlantUML should handle automatically this situation without the user having to specify a "-right->" syntax.

However, this modification may be tricky to be done, so please be patient :-)

We'll post a message here when a new beta will be ready.

Thanks again for the suggestion!
answered Mar 2 by plantuml (124,290 points)
We have a beta that should work with your example:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
Is this what you were expecting ?
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...