A message represents an interaction
between objects, or between an object and the environment. A message
can be an event, a triggered operation, or a primitive operation.
In
the metamodel, a message defines a specific type of communication.
The communication can be raising a signal, starting an operation,
or creating or destroying an instance.
About this task
The recipient of a message is either a
class or a reactive class. Reactive classes have statecharts, whereas
nonreactive classes do not. Reactive classes can receive events, triggered
operations, and primitive operations. Non-reactive classes can receive
only messages that are calls to primitive operations. Events are typically
shown with slanted arrows to imply that they are asynchronous (delivery
takes time). Triggered operations are shown with straight arrows to
imply that they are synchronous (happen immediately).
Procedure
- Depending on what type of message you want,
click the Message button
or
the Event button
.
Note: Use the Message button for messages for operations. By
default, the product creates a primitive operation with public access.
Use the Event button for messages for events. Notice the different
arrowheads for the different message types.
- Move the cursor over the instance lines.
Note: A plus sign displays on each instance line
as you move the cursor from one to the next. This symbol indicates
a potential origination point for the wanted message.
- Right-click to anchor the start of the message
at the intended location, then move the cursor. A dashed line displays
as a guide for the message.
- Move the cursor lower the start of the message
to create a downward-slanted diagonal line and click the target object
line to anchor the end of the message.
- If you specified design mode, and the specified
message is not realized in the model, the product asks if you want
to realize it. Click OK.
Results
The product creates a message with the default
name message_n(), where n is an incremental
integer starting with 0. Sequence diagrams automatically expand in
length to accommodate new messages. To set or change the features
for a message, double-click it to open its Features window.