Sequence Diagram - Create within an existing box

0 votes
asked Oct 27, 2018 in Question / help by Steve2004
I can't figure out how to create a participant within an already existing box.  When I do the following, It creates a second box "Computer1".

@startuml

box "Computer1"
participant ProcessA
end box

ProcessA -> ProcessA : Init

box "Computer1"
Create participant ProcessB
end box
ProcessA -> ProcessB : Spawn Process

@enduml

1 Answer

0 votes
answered Oct 27, 2018 by albert (3,230 points)

Not 100% sure if this is what you want:

@startuml
box "Computer1"
participant ProcessA

ProcessA -> ProcessA : Init

Create participant ProcessB

ProcessA -> ProcessB : Spawn Process

end box

@enduml

http://www.plantuml.com/plantuml/png/SoWkIImgAStDuKhAhr1GSixFBIWjIIqoLE8g08fd9cSM9EQLA0GKvIUd5XSxSgbpSS7O2hfs2d2sbO9dNcO95vSwkYdEHQc99QaAM0npuahDIr40giTceXFGnE22nF8yc02N0r0rq9a0

commented Oct 27, 2018 by stevew2004
Yes, it absolutely does.  In my "real" diagram of course I have some other boxes, so I will need to organize my steps in terms of the boxes, not in the order the messages actually happen, but I think I can accomplish that by using the "order" option on messages.   Not sure if that makes sense, but yes, you answered my question!
commented Oct 27, 2018 by albert (3,230 points)
@plantuml Maybe there is a possibility to extend the box facility withe some sort of merge action.
...