plantuml / backlog

Contains all issues for plantuml that are not currently working-in-progress
0 stars 0 forks source link

goto in activity diagram draws over other arrows/lines #19

Open nmz787 opened 5 years ago

nmz787 commented 5 years ago

Since the while "break" syntax is not fully working (see issue 174) I attempted to use GOTO and label commands instead, taking into account that it is only implemented for reverse-goto now. Unfortunately the output is unreadable, with the green goto lines being drawn on top of lots of other content (boxes, other lines, arrows)

Here's an example goto example

@startuml
skinparam padding 10
skinparam partitionBorderThickness 4

start
partition #BUSINESS "first file" {
  :start things;
    partition #PaleGoldenRod "first idea" {
    :<b>if</b> running in <b>mode A</b>, <b>then</b> all the <b>following code</b> is wrapped in a while loop "<b>while (command was NOT "quit")</b>";
    :call startup code>
    partition #Thistle "second file <b>the starting function()</b>" {
      :if this is the first time being called,
      it will send an email to the user;
    partition #MediumSpringGreen "third file <b>loop_function()</b>" {
        while (command was NOT "quit")
        :open a TCP/IP socket, unless the <b>goto_label</b> flag was previously set;
        label while_loop_start
        :when data is received on the socket, call processing function>
        partition "fourth_file.c <b>processing()</b>" {
          if (command == "read")
            if (perform readA SUCCEEDS) then (True)
              #LawnGreen:send result to client;
              :restart while loop;
              goto while_loop_start
            endif
            :set <b>goto_label</b> variable, then return to <b>first idea</b>;
            :jump back to this line (using the C "goto" syntax);
            if (<bfirst idea</b> read SUCCEEDS) then (True)
              #LawnGreen:send result to client;
              :restart while loop;
              goto while_loop_start
            endif
            if (last chance)
              :perform last chance code;
              #LawnGreen:send a 0 to client;
              goto while_loop_start
            endif
          elseif (command == "write")
            if (perform writeA SUCCEEDS) then (True)
              #LawnGreen:send result to client;
              :restart while loop;
              goto while_loop_start
            endif
            :set <b>goto_label</b> variable, then return to <b>first idea</b>;
            :jump back to this line (using the C "goto" syntax);
            if (first idea write SUCCEEDS) then (True)
              #LawnGreen:send result to client;
              :restart while loop;
              goto while_loop_start
            endif
            if (last chance)
              :perform last chance code;
              #LawnGreen:send a 0 to client;
              goto while_loop_start
            endif
          elseif (command is alternate)
            :other processing;
            #LawnGreen:send result to client;
            :restart while loop;
            goto while_loop_start
          endif
          if (other commands) then (True)
            :perform relevant processing;
          endif
        }
      endwhile
      }
    }
  }
}

@enduml
arnaudroques commented 1 year ago

Can you provide a shorter example that shows the issue? Thanks!