Create a UML sequence diagram

Show me an example

On the File menu, point to New, point to Software, and then click UML Model Diagram. In the tree view (tree view: Displayed in a window in the UML Navigator, a hierarchy in which each UML element or view (diagram) is represented by an icon. The UML template automatically creates a tree view of your model.), right-click the package (package: A grouping of model elements represented in the UML by a symbol that resembles a manila file folder. Each element in a system can be owned by only one package, and one package can be nested in another.) or subsystem in which you want to include the sequence diagram (sequence diagram: An interaction diagram that shows the objects participating in a particular interaction and the messages they exchange arranged in a time sequence.), then point to New, and then click Sequence Diagram.

A blank page appears, and the UML Sequence stencil becomes the top-most stencil. The workspace displays 'Sequence' as a watermark. An icon representing the diagram is added to the tree view.

 Note   If the tree view is not visible, on the UML menu, point to View, and then click Model Explorer.

For each object (object: Information created in another application and imported, embedded, or linked in a Visio drawing. The term object is used to refer to objects from other applications and OLE objects.) involved in the interaction the sequence diagram represents, drag an Object Lifeline shape onto the drawing page. Adjust the lengths of the lifelines to correspond to the lengths of the objects' lives in the interaction, and add destruction markers to lifelines for objects that are destroyed.

Work with Object Lifeline shapes

Indicate that an object in a sequence diagram is destroyed

In a sequence diagram (sequence diagram: An interaction diagram that shows the objects participating in a particular interaction and the messages they exchange arranged in a time sequence.), drag an Object Lifeline shape onto the drawing page to represent an object that is destroyed during the interaction the sequence diagram represents. Right-click the Object Lifeline shape, click Shape Display Options, and then select Destruction marker.

 Note   To apply this change only to the selected shape, clear the option Apply to the same selected UML shapes in the current drawing window page in the UML Shape Display Options dialog box.

A black X appears at the end of the object's lifeline.

Double-click an Object Lifeline shape. In the UML Classifier Role Properties dialog box, click ClassifierRole. Do one of the following:

The appearance of the object icon may change to reflect the classifier you chose.

To indicate when an object is performing an action, drag an Activation shape onto the object's lifeline. Glue the endpoints of the Activation shape to connection points on the Object Lifeline shape. Adjust the length of the activation rectangle to correspond to the object's period of activity.

Work with Activation shapes

Indicate transition times on a sequence diagram

In the tree view (tree view: Displayed in a window in the UML Navigator, a hierarchy in which each UML element or view (diagram) is represented by an icon. The UML template automatically creates a tree view of your model.), double-click the icon representing the sequence diagram (sequence diagram: An interaction diagram that shows the objects participating in a particular interaction and the messages they exchange arranged in a time sequence.) to which you want to add transition times.

The drawing page with the sequence diagram appears.

On the toolbar, select the Text tool. On the drawing page, click where you want to add the name of the message instance, which represents the time the message (message: In a sequence diagram, a communication between objects that conveys information and results in an action. A message is represented by a horizontal arrow.) is sent, and then type the name.

Usually, the name appears in the left margin of the diagram aligned with the message to which it applies. The name can be a simple letter, such as a or b.

On the toolbar, select the Pointer tool. Drag a Constraint shape onto the drawing page near the message name. Double-click the shape, and under Body, type any constraint information relevant to the message time (for example, b - a < 1 sec). Click OK.

 Tip   If the delivery of a message is not instantaneous, slant the message line and name the time the message is received with the same letter as the time the message is sent, but add a prime (for example, a for the time sent and a' for the time received).

Information about messages can be added to the left margin

A sequence diagram with named times for when messages are sent and received.
Show conditionality on a sequence diagram object

In a sequence diagram (sequence diagram: An interaction diagram that shows the objects participating in a particular interaction and the messages they exchange arranged in a time sequence.), drag a Lifeline shape onto the drawing page near the object lifeline (object lifeline: In a sequence diagram, a representation of the existence of an object at a particular time. If the object is created or destroyed during the time period the diagram represents, then the lifeline stops or starts at the appropriate point.) on which you want to show conditionality. Glue the endpoints of the Lifeline shape to connection points Connection point image - blue X on the Object Lifeline shape. To extend the conditional lifeline, drag a control handle on the Lifeline shape. Double-click the Lifeline shape to open its UML Properties dialog box where you can add a name and other property values to the lifeline.

 Tip   You can also glue the endpoints of a Lifeline shape to connection points on an Activation shape associated with an object lifeline.

Use Message shapes to indicate communication between the objects.

Work with Message shapes

Indicate a message between objects on a sequence diagram

In a sequence diagram (sequence diagram: An interaction diagram that shows the objects participating in a particular interaction and the messages they exchange arranged in a time sequence.), drag a Message shape onto the drawing page.

The message shape you choose depends upon the kind of message you want to send (regular, asynchronous, procedure call, or return).

Glue the message endpoint without the arrowhead to a connection point Connection point image - blue X on the lifeline of the object sending the message. Glue the message endpoint with the arrowhead to a connection point on the lifeline of the object receiving the message. Double-click the message and then type or choose the message name, stereotype, sequence expression, and flow kind. For a flat message or procedure call, choose the operation you want the message to generate. If the operation doesn't exist, click New to create it.

For an asynchronous message, choose the signal you want the message to generate. If no reception for the signal exists on the classifier that the object lifeline receiving the message is based on, click New to create the reception.

 Tip   To indicate a message from an object to itself, glue the two endpoints on an arc-shaped Message shape to two connection points on the same object lifeline.

Double-click any shape to open its UML Properties dialog box, where you can add a name and other property values. Save the diagram.

 
 
Applies to:
Visio 2003