PlantUML Activity diagram special Box Layout Output is needed

822 Views Asked by At

I have a problem and tried to solve it for the last 2 Days.

I want to design an activity diagram/flow chart like this:

Step1

Step2

Step3 --------->Output of Step 3

Step4

I can't draw/program an arrow which starts directly out of the box "Step3" and the Box "Output of Step 3" too without any layout problems.

My current code:

@startuml Test1

title Flowchart

|System 1|

start

:Step1;

:Step2;

split

:Step3;

|System 2|

split again

:Output of Step3;

detach

|System 1|

end split

:Step 4;

stop

@enduml
1

There are 1 best solutions below

1
Fuhrmanator On BEST ANSWER

Activity Diagrams in UML have certain rules. Using split is probably a bad idea, as it's intended for the SDL aspect of PlantUML.

Perhaps you can try with fork if you want to show the output in a separate swimlane:

@startuml Test1

title Flowchart
|System 1|
start
:Step1;
:Step2;
:Step3;
fork
:Step 4;
|System 2|
fork again
:Output of Step3]
stop
|System 1|
end fork
stop

@enduml

enter image description here

I put a stop at the end of the output (which is now an object using the ] ending) to prevent the line rejoining the flow in System 1.

Another alternative is to use the legacy syntax for Activity diagrams, which doesn't allow for swimlanes, but can do partitions.

@startuml Test2

title Flowchart
partition "System 1" {
 (*) --> "Step 1"
 --> "Step 2"
 --> "Step 3"
 --> "Step 4"
 --> (*)
}
partition "System 2" {
    "Step 3" -> "<< object >>\nOutput of Step 3"
}

@enduml

enter image description here

In the legacy syntax for Activity Diagrams, it's not possible (as far as I know) to make an "object" (rectangle) shape.