systemcomposer.interaction.Message
Description
A Message
object represents a communication between two lifelines
of an interaction. On the sequence diagram representing the interaction, a message is shown as
an arrow. Messages have labels that can describe the communication occurrence either formally
or informally. A message corresponds to a connector connecting ports of two components in an
architecture model.
A message label has a trigger, an optional guard, and an
optional constraint in the form of trigger[guard]{constraint}
.
trigger
represents the identifying event for this message.
guard
represents an additional condition to determine whether the message
occurs. constraint
is an expression that is expected to be true when this
message occurs.
In signal events, the trigger follows this format:
direction(signal [+|-] value)
, which specifies a triggering edge with a direction and an expression. The direction can be:Rising — The edge expression is rising from strictly below zero to a value equal to or greater than zero.
Falling — The edge expression is falling from strictly above zero.
Crossing — The edge expression either rising or falling past zero.
In message events, the trigger is in the format
port
, which specifies the name of the input message port and represents the arrival of a message.A guard in square brackets on the message label is a MATLAB® Boolean expression that is an additional condition to determine whether the message occurs. Evaluation of the guard only occurs once the software detects a valid trigger. During execution, the sequence diagram waits to proceed to the next message until the guard expression evaluates to true.
A constraint in curly brackets on the message label is a MATLAB Boolean expression that specifies an expected value of inputs to the destination lifeline. During execution, the evaluation of the constraint determines whether the sequence diagram shows a pass or fail for that message.
Creation
Access Message
objects via the RootFragment
property
of the corresponding systemcomposer.interaction.Interaction
object. Iterate over the root fragment to
inspect the systemcomposer.interaction.MessageEvent
objects within the fragments. Access the
Message
property of the message event to inspect the corresponding
Message
object.
Properties
Examples
More About
Version History
Introduced in R2024a
See Also
Tools
Functions
openViews
|sim
|addInteraction
|getInteraction
|getInteractions
|open
|addLifeline
|addFragment
|addOperand
|addMessage
|addDurationConstraint
|addAnnotation
|findLifeline
|findElement
|move
|move
|move
|destroy
|next
|current
|reset
Objects
systemcomposer.arch.Model
|systemcomposer.interaction.Interaction
|systemcomposer.interaction.Iterator
|systemcomposer.interaction.Lifeline
|systemcomposer.interaction.MessageEvent
|systemcomposer.interaction.FormalGate
|systemcomposer.interaction.Fragment
|systemcomposer.interaction.Operand
|systemcomposer.interaction.DurationConstraint
|systemcomposer.interaction.Annotation