In a sequence diagram, can we send a message to a box?

0 votes
asked Jun 21, 2019 in Wanted features by PlantUML Fan

Hello.  I am making a sequence diagram with -say- 3 participants: outside, thread1, thread2.

thread1 and thread2 are entities that belong together in a box called process.  And outside can send messages to either thread1 or thread2, but it can also send a message to the process in general.

But, for illustrative purposes, I'd like to outside to send messages to the process containing inside1 and inside2:


box process

    participant thread1

    participant thread2

end box

outside -> thread1 : Send task.

ouside ->process : shutdown


Is this possible?  And if so, how would I do it?  Thanks.

1 Answer

0 votes
answered Jun 24, 2019 by ichi

Are "thread1" and "thread2" objects instead of classes?
If so, draw an object diagram instead of a sequence diagram.
And object diagrams can handle packages like class diagrams.
Are you looking for a diagram like this?

package process {
    Object thread1
    Object thread2
Object outside

outside -> thread1 : Send task.
outside ->process : shutdown

Are you looking for a time series representation like a sequence diagram?

commented Jun 28, 2019 by mgrol (3,150 points)


not really, you won't get a handle on the box which is 

you might fake it like this 

Which is a result of the following code:

box "process"
participant process
    create thread1
process -> thread1
    create thread2
process -> thread2
end box
outside -> thread1 : Send task to thread 1

outside -> process : shutdown