Message (Sequence Diagram)
Sequence diagrams depict work flow or activity over time using Messages passed from element to element. These Messages correspond in the software model to Class operations and behavior. They are semantically similar to the Messages passed between elements in a Communication diagram, and can be of many different types.
To create a Message on a Sequence diagram, follow the steps below:
- Access the Sequence diagram. The Interaction pages of the Toolbox display.
- In the Interaction Relationships page, click on the Message icon, click on the source object and drag the cursor to the destination (target) object. The Message Properties dialog displays (if not, right-click on the Message and select the Message Properties context menu option).
- In the Message field, type the Message name.
- In the Parameters field, type any parameters that the Message has, as a comma-separated list. If required, in the Parameter Values field type the actual value for each parameter, again as a comma-separated list.
- If the Message is a return message, in the Return Value field enter the returned value or type.
It is possible to depict returns from a Self Message. Simply create a second Self Message at the end of execution and select the Is Return checkbox in the Control Flow Type panel.
- If the Message flow is from a Class element or Lifeline element with classifier that has defined attributes, click on the drop-down arrow in the Assign to field and select an appropriate attribute name. The Message reflects the attributes from the source Class. You cannot add further attributes to the source Class here - if no appropriate attribute is listed, open the element Properties dialog and add the required attribute.
Otherwise, if required, type the name of the object to assign the message flow to.
- In the Stereotype field, type or select an optional stereotype for the connector (this is displayed on the diagram, if entered).
- If required, in the Alias field type an alias for the name of the Message.
On the diagram, the alias displays if the Use Alias if Available checkbox is selected on the Diagram tab of the Diagram Properties dialog. The Alias displays instead of or as well as the Message name, depending on the setting selected in the Alias Usage panel of the Diagram Behavior page of the Options dialog.
- In the Condition field, type any conditions that must be true in order for the message to be sent.
- In the Synch: field in the Control Flow Type panel, select Synchronous or Asynchronous as appropriate.
- In the Lifecycle field, select New to create a new element at the end of the Message, or Delete to terminate the message flow at the end of the Message. If neither case applies, leave the field at the default of <none>.
- If required, in the Notes field type any explanatory notes. You can format the notes using the Notes toolbar at the top of the field.
- Click on the OK button to save the Message definition.
Co-Region notation can be used as a short hand for parallel combined fragments. To access the Co-Region submenu, right-click on a connector in a Sequence diagram and select the Co-Region context menu option. There are four sub-options available:
- Start at head
- End at head
- Start at tail
- End at tail.