Proposal for fixing some layout deficiences

0 votes
asked Mar 2, 2017 in To be sorted by mnlipp (240 points)

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.

1 Answer

0 votes
answered Mar 2, 2017 by plantuml (294,960 points)
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!
commented Mar 3, 2017 by plantuml (294,960 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 ?
...