- UML - Home
- UML - Overview
- UML - Challenges & Real-world Applications
- UML - Building Blocks
- UML - Architecture
- UML - Modeling Types
- UML - Basic Notations
- UML - Standard Diagrams
- UML - Class Diagram
- UML - Object Diagram
- UML - Component Diagram
- UML - Deployment Diagram
- UML - Use Case Diagram
- UML - Interaction Diagram
- UML - Statechart Diagram
- UML - Activity Diagram
- UML - Communication Diagram
- UML - Timing Diagram
- UML - Sequence Diagram
- UML - Collaboration Diagrams
- UML - Profile Diagram
- UML - Sequence Vs. Collaboration Diagrams
- UML - Sequence Vs. Collaboration Vs. Communication Diagrams
- UML - Association Vs. Aggregation Vs. Composition
- UML - Interaction Overview Diagram
- UML - Composite Structure Diagram
- UML - Object Constraint Language
- UML - Managing Models
- UML - Summary
- UML Useful Resources
- UML - UML Interview Questions & Answers
- UML - Useful Resources
- UML - Knowledge Test
UML - Creating a Sequence Diagram
To design a sequence diagram, make use of a UML Sequence template or starter diagram, which includes the UML Sequence stencil. Drag shapes from the stencil onto the drawing canvas to build the diagram.
Starting a Sequence Diagram
Step 1. Launch Visio. Alternatively, if you already have a file open, select File > New.
Step 2. Type the UML sequence in the Search box.
Step 3. Choose the UML Sequence diagram.
Step 4. In the dialog box, either select the blank template or one of the three starter diagrams (descriptions of each will appear on the right when selected). Then, choose either Metric Units or US Units.
Step 5. Click Create.
The diagram will open, and the Shapes window should appear beside the diagram. If it isnt visible, navigate to View > Task Panes and ensure Shapes is selected. If it still doesnt appear, click the Expand Shapes window button on the left.
In the View tab, make sure the checkbox next to Connection Points is ticked. This option allows connection points to be visible when connecting shapes.
Now, drag shapes from the Shapes window to the canvas. To change text labels, double-click the labels.
Lifelines for Actors and Objects
For each participant, use an Actor lifeline shape, and for each system component in your process, use an Object lifeline shape.
Note − When positioning lifelines, green alignment guides will appear on the screen to assist with proper alignment and spacing.
Double-click the heading box of each lifeline to enter its name or title. To modify the length of a timeline, select the lifeline and drag the yellow control point at the bottom.
Messages
Use message shapes to show the information exchanged between lifelines.
Note − Visio helps attach message endpoints to each lifeline. A green circle will appear at the endpoint when it attaches to a connection point. These connection points will vanish once the message is connected.
Attach the beginning endpoint to the lifeline sending the message, and drag the endpoint with the arrowhead to the receiving lifeline.
Double-click the message shape to create a text box and type the message name.
Message Shape Types
- Message shape (a solid line) for a request or information transfer.
- Return Message shape (a dashed line) to represent a reply to a prior message.
- Self Message for a recursive call or a method invoking another method within the same object.
- Asynchronous Message shape for actions that might not occur immediately.
To change the shape of a connector message −
- Right-click the connector.
- At the bottom of the pop-up menu, select one of the three options: Right-Angle, Straight, or Curved.
- Select and drag the connector to modify its shape.
Fragments
When one or more interactions form a loop or require a condition to complete, enclose them in a fragment shape −
- Loop fragment for a repetitive interaction.
- Optional fragment for steps that are performed only if a certain condition is met.
- Alternative fragment for an if-then or if-then-else sequence. The fragment contains two sections to show alternative interactions. To add another condition, drag an Interaction operand onto the shape.
Drag the fragment shape over the relevant interactions and adjust its size using the sizing handles.
Double-click the title corner of the fragment shape to add a title or brief description. Below the title corner, select the [parameters] prompt to input the conditions that end the process.
Activation
To show when an object or participant is active in the process, place an Activation bar shape on a lifeline. Typically, arrows connect to and from the activation box to illustrate the flow of information.
Drag the endpoints of the Activation bar up or down to adjust its length.
Destruction
Destruction indicates when an object or actor has finished participating in the system. A large X will appear at the end of its lifeline. To represent the destruction of an object −
- Right-click the object.
- Select Show Destruction.