Sequence Diagrams
Sequence diagrams visualize how objects interact over time. They show the order of messages exchanged between participants to accomplish a specific task or scenario.
Core Concepts
Participants
Participants represent the objects or actors involved in the interaction. Each participant has a lifeline - a vertical dashed line extending downward that represents time.
Messages
Messages are the communications between participants, shown as horizontal arrows between lifelines. Time flows from top to bottom.
Activation Boxes
Activation boxes (also called execution specifications) are thin rectangles on a lifeline that show when a participant is actively processing.
Creating Participants
Using the Participant Tool
Press P to activate the Participant tool, then click on the canvas to place participants.

Participant Types
Participants can represent different types of entities:
- Actor - A user or external system (stick figure icon)
- Object - An instance of a class (rectangle)
- Component - A system component (rectangle with stereotype)
- Boundary - UI or system boundary
- Control - Process or controller logic
- Entity - Data or domain object
Configure the participant type in the Inspector panel.
Creating Messages
Using the Message Tool
Press M to activate the Message tool, then:
- Click on the source participant's lifeline
- Drag to the target participant's lifeline
- Release to create the message
Message Types
| Type | Arrow Style | Description |
|---|---|---|
| Synchronous | Solid line, filled arrow | Sender waits for response |
| Asynchronous | Solid line, open arrow | Sender continues without waiting |
| Return | Dashed line, open arrow | Response to a synchronous call |
| Create | Dashed line, open arrow to box | Creates a new participant |
| Destroy | Line ending with X | Terminates a participant |

Message Labels
Double-click on a message to edit its label. Common formats:
methodName()- Simple method callmethodName(param1, param2)- Call with parametersresult := methodName()- Call with return assignment[condition] methodName()- Conditional message (guard)
Activation Boxes
Activation boxes show the period during which a participant is executing or waiting for a response.
Adding Activation Boxes
- Select a message
- In the Inspector, enable "Show Activation"
- The activation box appears on the receiving participant's lifeline
Nested Activations
When a participant calls itself (recursive call) or handles multiple nested calls, activation boxes can be stacked.

Fragments
Fragments group messages to show conditional logic, loops, or other control flow.
Fragment Types
| Type | Keyword | Purpose |
|---|---|---|
| Alternative | alt | If-else branching |
| Option | opt | Optional execution (if without else) |
| Loop | loop | Repeated execution |
| Break | break | Exit from enclosing loop |
| Parallel | par | Concurrent execution |
| Critical | critical | Atomic/critical section |
Creating Fragments
- Select the messages you want to group
- Right-click and choose "Add Fragment" or use the Fragment tool
- Select the fragment type
- Add conditions/guards as needed

Fragment Guards
Guards are conditions shown in square brackets:
[x > 0]- Numeric condition[user.isAdmin]- Property check[else]- Default/else branch in alt fragments
Reordering Elements
Moving Participants
Drag participants horizontally to reorder them. Connected messages will follow.
Moving Messages
Drag messages vertically to change their order in the sequence. This affects the timing/order of the interaction.
Best Practices
- Start with the main flow - Model the happy path first, then add alternatives
- Keep it readable - Limit to 5-7 participants per diagram
- Use meaningful names - Label messages with actual method names or descriptions
- Show return messages - Especially for synchronous calls where the return value matters
- Use fragments sparingly - Too many nested fragments reduce readability
- Add notes - Use note elements to explain complex logic
Example: User Login Flow
A typical login sequence might include:
- User enters credentials
- Client sends login request to Server
- Server validates with Database
- Database returns user record
- Server creates session
- Server returns success/failure to Client
- Client updates UI
This flow demonstrates synchronous calls, return messages, and potential alt fragments for success/failure paths.