Simple Example

We use -> to indicate the message transfer between participants, without explicitly declaring participants.

You can also use --> to indicate a dashed line.

You can also use <--, <-; these two symbols do not affect the drawing effect, only affect the readability

You can try to modify the content in the text box below, and then check the changes in the picture on the right

Declare participants

You can use the following keywords to declare participants:

  • participant
  • actor
  • boundary
  • control
  • entity
  • database
  • collections
  • You can try to modify the content in the text box below, and then check the changes in the picture on the right

    Use non-letter symbols in participants

    We can use quotation marks to define participants, and we can also use the keyword as to define aliases for participants.

    You can try to modify the content in the text box below, and then check the changes in the picture on the right

    Message yourself

    Participants can send messages to themselves

    You can try to modify the content in the text box below, and then check the changes in the picture on the right

    Auto number

    We can user autonumber to auto number messages

    You can try to modify the content in the text box below, and then check the changes in the picture on the right

    Delimiter

    We can use the == keyword to divide your chart into multiple steps.

    You can try to modify the content in the text box below, and then check the changes in the picture on the right

    Hide footbox

    user hide footbox keyword to hide footbox.

    You can try to modify the content in the text box below, and then check the changes in the picture on the right

    Page title, header, footer

    use title keyword to add title
    use header keyword to add header
    use footer keyword to add footer

    Combined message

    Messages can be combined through the following keywords:

    • alt/else
    • opt
    • loop
    • par
    • break
    • critical
    • group

    Followed by the content of the message
    You can add text that needs to be displayed in the header (except for group).
    The keyword end is used to end the grouping.
    *Note that grouping can be nested.

    Comment on the message

    We can add notes to the message by adding the note left or note right keywords at the end of the message. You can also add multiple lines of notes by using end note.

    Other notes

    You can use note left of, note right of or note over to place notes relative to the participant.
    You can also highlight the comment by changing the background color.
    And use the keyword end note to add multi-line notes.

    Reference

    We can use the ref over keyword in the figure to achieve reference.

    Delay

    We can use ... to indicate the delay, and we can also add a comment to the delay.

    Text wrap

    We can manually pass \n to wrap the line.
    You can also use maxMessageSize.

    Space

    We can increase the space by using |||. You can also use numbers to specify the number of pixels added.

    Activation and deactivation of lifeline

    The keywords activate and deactivate are used to represent the life activities of participants.
    Once the participant is activated, its lifeline will be displayed.
    Activate and deactivate apply to the above situations.
    Destroy represents the end of a participant's lifeline.

    You can also use nested lifelines, and run to add colors to the lifelines.

    Enter and send out messages

    If you only want to follow some of the icons, you can use the enter and send arrows.
    Use square brackets [and] to indicate the left and right sides of the diagram.

    Package participants

    You can use box and end box to draw a box to wrap the participants.
    You can also add a title or background color after the box keyword.

    © 2020-2022 NutUml