How to destroy a participant?

0 votes
asked Jun 5 in Question / help by anonymous
Hello.  Thanks for this wonderful tool that is easy to use!  Anyways, I have a question:

In a sequence diagram, we can 'create' a participant so that its first appearance is not at the top of the diagram, but at the moment of creation.  Now is there a way to destroy a participant so that it disappears at the moment of destruction?  I would like to show that a temporary helper class/instance is created and after a certain time destroyed.  The create command allows me to the former, but I can't find the latter.  I plan to show  a create/destroy pair twice in a sequence diagram.

is there such a way?  Thanks.

1 Answer

0 votes
answered Jun 8 by mgrol (1,920 points)

Hi,

I assume this is what you want:

@startuml
Bob -> Alice : hello
create dummy
Alice -> dummy
Alice <-- dummy
destroy dummy
Bob <- Alice
Cesar -> Cleo
create dummy
Cleo -> dummy
Cleo <-- dummy
destroy dummy
Cesar <-- Cleo
@enduml

This can be easily found here http://plantuml.com/sequence-diagram, just search for "create" or "destroy"

BR,

Michael

...