Split/While Bug - with a couple of workarounds

0 votes
asked Jun 6 in Question / help by rod_makin (120 points)

Not sure if this is a bug, a feature, or this might simply help someone work around an issue I have found.

It seems that the split function has an issue with the while loop in swim lanes if the while statement does not land in the same swim lane that its initiated. The way that it manifests itself is that the line drawn back up to the top of the loop just simply isnt there.

Interestingly it does work if you choose to use fork, or explicitly force the final block back into the originating swimlane.

All gobble-de-goop? The source code for 3 examples below:)

First Example Split Bug Not Working

@startuml
title Split Bug (not working)
|SDE|
|Customer|
|SDE|
:Something;
repeat
     :Repeat Bug;
     split
          :something; 
     split again
|Customer|
           :Something Else;
      end split
|SDE|
repeat while(\nRepeat?\nYes=Down\nNo=Right\n)
:something;
@enduml

Second Example where switching to Fork works

@startuml
title Split Bug (working using fork)
|SDE|
|Customer|
|SDE|
:Something;
repeat
     :Repeat Bug;
     fork
          :something; 
     fork again
|Customer|
           :Something Else;
      end fork
|SDE|
repeat while(\nRepeat?\nYes=Down\nNo=Right\n)
:something;
@enduml

Last Example where I force the diagram back into the original swimlane
@startuml
title Split Bug (force back in right swim lane)
|SDE|
|Customer|
|SDE|
:Something;
repeat
     :Repeat Bug;
     split
          :something; 
     split again
|Customer|
           :Something Else;
      end split
|SDE|
:Get back here!!;
repeat while(\nRepeat?\nYes=Down\nNo=Right\n)
:something;
@enduml

Hope this helps someone:)

1 Answer

0 votes
answered Jun 7 by plantuml (208,860 points)
Thanks for the report : it's definitively a bug.

It should be fixed in last beta http://beta.plantuml.net/plantuml.jar

Tell us if you find other issues!
...