Messages

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  UML Diagrams > Behavioral Diagrams > Sequence Diagram > Inserting sequence diagram elements >

Messages

Messages are sent between sender and receiver lifelines, and are shown as labeled arrows. Messages can have a sequence number and various other optional attributes: argument list etc. Messages are displayed from top to bottom, i.e. the vertical axis is the time component of the sequence diagram.

 

A call is a synchronous, or asynchronous communication which invokes an operation that allows control to return to the sender object. A call arrow points to the top of the activation that the call initiates.
Recursion, or calls to another operation of the same object, are shown by the stacking of activation boxes (Execution Specifications).

 

 

To insert a message:

1.Click the specific message icon in the Sequence Diagram toolbar.
2.Click the lifeline, or activation box of the sender object.
3.Drag and drop the message line onto the receiver objects lifeline or activation box. Object lifelines are highlighted when the message can be dropped.

 

The direction in which you drag the arrow defines the message direction. Reply messages can point in either direction.
Activation box(es) are automatically created, or adjusted in size, on the sender/receiver objects. You can also manually size them by dragging the sizing handles.
Depending on the message numbering settings you have enabled, the numbering sequence is updated.
Having clicked a message icon and holding down Ctrl key, allows you to insert multiple messages by repeatedly clicking and dragging in the diagram tab.

 

 

To delete a message:

1.Click the specific message to select it.
2.Press the Del. key to delete it from the model, or right click it and select "Delete from diagram". The message numbering and activation boxes of the remaining objects are updated.

 

"Go to operation" for call messages:

The operations referenced by call messages can be found in sequence and communication diagrams.

 

1.Right-click a call message and select "Go to Operation".

goto-op

The display changes and the connect operation is displayed in the Model Tree tab.

goto-op2

 

Note: Static operation names are show as underlined in sequence diagrams.

static-op

 

To position dependent messages:

Click the respective message and drag vertically to reposition it.

 

The default action when repositioning messages is it to move all dependent messages related to the active one. Using Ctrl+Click, allows you to select multiple messages.

 

 

To position messages individually:

1.Click the Toggle dependent message movement icon ic-togg-dept-msg-movt to deselect it.
2.Click the message you want to move and drag to move it.

 

Only the selected message moves during dragging. You can position the message anywhere in the vertical axis between the object lifelines.

 

 

To automatically create reply messages:

1.Click the "Toggle automatic creation of replies for messages" icon ic-togg-replymsg.
2.Create a new message between two lifelines. A reply message is automatically inserted for you.

 

Message numbering

UModel supports different methods of message numbering: nested, simple and none.

 

None ic-no-msg removes all message numbering.
Simple ic-simple-msg assigns a numerical sequence to all messages from top to bottom i.e. in the order that they occur on the time axis.
Nested ic-nested-msg uses the decimal notation, which makes it easy to see the hierarchical structure of the messages in the diagram. The sequence is a dot-separated list of sequence numbers followed by a colon and the message name.

mess-number

There are two methods of selecting the numbering scheme:

 

Click the respective icon in the icon bar.
Use the Styles tab to select the scheme.

 

 

To select the numbering scheme using the Styles tab:

1.Click the Styles tab and scroll down to the Message Numbering field.
2.Click the combo box and select the numbering option you want to use. The numbering option you select is immediately displayed in the sequence diagram.

 

Note:The numbering scheme might not always correctly number all messages, if ambiguous traces exist. If this happens, adding return messages will probably clear up any inconsistencies.

 

Message replies

Message reply icons are available to create reply messages, and are displayed as dashed arrows.

mess-response

Reply messages are also generally implied by the bottom of the activation box when activation boxes are present.  If activation boxes have been disabled (Styles tab | Show Execution Specifics=false), then reply arrows should be used for clarity.

 

Activating the ic-togg-replymsg "toggle reply messages" icon, automatically creates syntactically correct reply messages when creating a call message between lifelines/activations boxes.

 

Creating objects with messages

1.Messages can create new objects. This is achieved using the Message Creation icon ic-msg-create.
2.Drag the message arrow to the lifeline of an existing object to create that object. This type of message ends in the middle of an object rectangle, and often repositions the object box vertically.

message-create

 

Sending messages to specific class methods/operations in sequence diagrams

Having inserted a class from the Model Tree into a sequence diagram, you can then create a message from a lifeline to a specific method of the receiver class (lifeline) using UModel's syntax help and autocompletion functions.

 

1.Create a message between two lifelines, the receiving object being a class lifeline (Bank). As soon as you drop the message arrow, the message name is automatically highlighted.
2.Enter a character using the keyboard e.g. "b". A pop-up window containing a list of the existing class methods is opened.

message-method-popup1

3.Select an operation from the list, and press Enter to confirm e.g. collectAccountInfos.
4.Press the space bar and press Enter to select the parenthesis character that is automatically supplied. A syntax helper now appears, allowing you to enter the parameter correctly.

message-method-param1

 

Creating operations in referenced classes

Activating the ic-create-op-inTarg Toggle automatic creation of operations in target by typing operation names icon, automatically creates the corresponding operation in the referenced class, when creating a message and entering a name e.g. myOperation().

 

Note:Operations can only be created automatically when the lifeline references a class or interface.

 

Message icons

 

ic-msg-call Message (Call)

ic-msg-reply Message (Reply)

ic-msg-create Message (Creation)

ic-msg-destruct Message (Destruction)

ic-msg-asyn-call Asynchronous Message (Call)

ic-msg-asyn-reply Asynchronous Message (Reply)

ic-msg-asyn-destruct Asynchronous Message (Destruction)

ic-togg-dept-msg-movt Toggle dependent message movement

ic-togg-replymsg Toggle automatic creation of replies for messages

ic-create-op-inTarg Toggle automatic creation of operations in target by typing operation names


© 2019 Altova GmbH