systemcomposer.interaction.Message
R2026bDescription
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 defines the conditions under which a message
occurs and what the message validates. A message label has a trigger, an optional guard, and an
optional constraint in the form of
trigger[guard]{constraint}.
Trigger — The identifying event for this message. The trigger format depends on the communication type:
Signal-based communication: The trigger follows the 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 is either rising or falling past zero.
For example, in the message label
rising(sw-1){sw==1}, the triggerrising(sw-1)fires when theswsignal rises from below1to a value of1or above.Message-based communication: The trigger is in the format
port, which specifies the name of the input message port and represents the arrival of a message. For example, in the message labelswitchEvent[switchEvent==1], the triggerswitchEventfires when a message arrives through theswitchEventport.
Guard (optional) — A MATLAB® Boolean expression in square brackets 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. For example, in
switchEvent[switchEvent==1], the guard[switchEvent==1]requires the value atswitchEventto be1for the message to occur.Constraint (optional) — A MATLAB Boolean expression in curly brackets 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. If a constraint expression is not specified, the evaluation of the trigger determines whether the sequence diagram shows a pass or fail for that message. For example, in
rising(sw-1){sw==1}, the constraint{sw==1}validates thatswequals1when the message fires.
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

