Draw a signal from one participant to another like this:
The participants are automatically created when they are used. Use the "-->" syntax to draw a dotted line.
To include a colon in a participant name, enclose it in quotes.
The next section describes how to save typing by declaring participant names.
Changing the order of participants
If you want to participants to be shown in a different order than they are used, declare them first using theparticipantkeyword. You can also rename them this way to save typing.
Signal to Self
A participant can send a signal to itself. This will result in an arrow that turns back on itself.
You may break the text into multiple lines by using "\n".
Grouping signals together
You can group signals together using thealt/else,opt,loop, andparkeywords. All of them can take a text description that will be displayed in the group header. Use theendkeyword to signal the end of a group. The groups may be nested to any depth.
Notes in the diagram
You can add notes to your diagram. Notes can be placed to the left of a participant or to the right of a participant. In addition, you can centre a note over one or more participants.
If a note contains more than one line, it will be not be word-wrapped. Instead, it will be formatted exactly as written.
Lifeline Activation and Destruction
Use the+and-with signals to denote object activation. While activated, the participant's lifeline will be highlighted.+will activate the receiver, and-will deactivate the sender.
Use*with signals to create a participant.A->*B: hello.
You can use thedestroykeyword to destroy a participant. The participant's lifeline will end at the previous signal.
Alternate Syntax
Get more control over activations using the
activate
and
deactivate
keywords. The commands apply to the previous signal.
Only arrows can cause activations
Activations and deactivations attach themselves to the previous signal. Neither a note or a state can cause a deactivation. If you want to deactivate spontaneously, use a signal-to-self.
One arrow can activate/deactivate many participants at a time
Include other diagrams (available in a purchased version)
You can refer to and include other diagrams that you have saved in your account without retyping the text. Use the word
include
followed by the filename in quotes.
You can use any file to which you have access, including those in shared folders.
Extended Text Descriptions (available in a purchased version)
Parallel signals (available in purchased version)
You can make different things happen at the same time using theparallelkeyword.
Use the serial keyword within a parallel block to describe two parallel sequences of operations.
States (available in purchased version)
A rounded box can be useful to show state information. The syntax is identical to thenotekeyword, except thatstateis used.
Autonumbering (available in purchased version)
Autonumbering will automatically prefix all signals with a number. To use it, include the line autonumber followed by the number to start with. To turn off autonumbering, use "autonumber off"
Reference other sequences (available in purchased version)
You can summarize or refer to sequences by drawing a box over one or more participants.
You can optionally have a signal going into the box or one coming out of it.
Footer types (available in purchased version)
Change the way the bottom of your diagram looks usingoption footer=.
# This is a comment.
Alice-
>
Bob: Filled arrow
Alice-
>
>
Bob: Open arrow
Bob--
>
Alice: Dotted line
Bob--
>
>
Alice: Dotted Line, open arrow
Bob
<
-
>
Alice: Double arrow
":Alice"-
>
":Bob": Hello
participant Bob
participant Alice
participant "I have a really\nlong name" as L
Alice-
>
Bob: Authentication Request
Bob-
>
Alice: Authentication Response
Bob-
>
L: Log transaction
Alice-
>
Alice: This is a signal to self.\nIt also demonstrates \nmultiline \ntext.
Alice-
>
Bob: Authentication Request
alt successful case
Bob-
>
Alice: Authentication Accepted
else some kind of failure
Bob-
>
Alice: Authentication Failure
opt
loop 1000 times
Alice-
>
Bob: DNS Attack
end
end
else Another type of failure
Bob-
>
Alice: Please repeat
end
participant Alice
participant Bob
note left of Alice
This is displayed
left of Alice.
end note
note right of Alice: This is displayed right of Alice.
note over Alice: This is displayed over Alice.
note over Alice, Bob: This is displayed over Bob and Alice.
participant Client
participant Server
parallel {
state over Server: LISTEN
state over Client: CLOSED
}
Client-
>
Server: SYN
parallel {
state over Client: SYN-SENT
state over Server: SYN_RECEIVED
}
Server-
>
Client: ACK