how to add a newly created participant in a exist box

0 votes
asked Nov 19, 2023 in Question / help by isaleo (120 points)
Hi, guys,

I got a problem to add a newly created participant in a exist box, instance as below:

https://www.plantuml.com/plantuml/uml/LP1T3i8W3CVVUufUOCcOlhY7PKulmg39I10MPEhnRHrBvAt_3tuD7PzPfxmzFCpnWvE2bQKpRjKXuzKxGnYJfOIghQ8fpYNeMg1WaP_3pkYguYsQM9gd6d7NBsTBTFw3x5kRGNRqk93t4NWKHs279RDuE-Pm4-Kj1LnSoPj1A2p19DAPaAN2uqyNOFchg3xG6qOAbc_n1G00

I want newly crreated Bob1 also in box B1, and B1 showed as a single box, does anybody have the experience to do that?

Many thanks.

1 Answer

0 votes
answered Nov 26, 2023 by kirchsth (7,140 points)

Hi,

you could make it like this (only list it in the box and then you can still create it afterwards)

@startuml
box B1
participant Alice order 10
participant Bob order 20
' add it here <----------------
participant Bob1 order 19
end box

box B2
participant Coco order 30
participant David order 40
end box

Alice -> Bob: hello
Bob -> Coco: hello
Coco -> David : hello
return hi

Coco -->Bob:hi

' you can create it here <----------------
create Bob1
Bob->Bob1:new
@enduml


BR Helmut

...