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}
, where
trigger
represents the identifying event for this message,
guard
represents an additional condition to determine whether the message
occurs, and 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 is either rising or falling past zero.
In message events, the trigger follows this 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 which is an additional condition to determine whether the message occurs. Evaluation of the guard only occurs once a valid trigger has been detected. 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 which 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
|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.RootFragment
|systemcomposer.interaction.AltFragment
|systemcomposer.interaction.OptFragment
|systemcomposer.interaction.LoopFragment
|systemcomposer.interaction.SeqFragment
|systemcomposer.interaction.StrictFragment
|systemcomposer.interaction.ParFragment
|systemcomposer.interaction.Operand
|systemcomposer.interaction.Annotation
|Simulink.SimulationInput
|Simulink.SimulationOutput
Topics
- Overview of System Composer API
- Describe System Behavior Using Sequence Diagrams
- Pivot Between Lifelines and Components in Views Gallery
- Compose Architectures Visually
- Implement Component Behavior Using Simulink
- Implement Component Behavior Using Stateflow Charts
- Implement Component Behavior Using Simscape