move - Move message within interaction - MATLAB (original) (raw)
Move message within interaction
Since R2024b
Syntax
Description
move([message](#mw%5F31397719-18a2-41c9-8646-e66dc7fc8937), Before=[beforeElement](#mw%5F9e000536-5000-4db1-b551-2f28ecf06cfc))
places the message specified by message
immediately before thebeforeElement
interaction element object.
move([message](#mw%5F31397719-18a2-41c9-8646-e66dc7fc8937), After=[afterElement](#mw%5F712adb47-e900-4237-9df5-92429b083bc0))
places the message specified by message
immediately after theafterElement
interaction element object.
Examples
You can programmatically move messages in a sequence diagram. This example assumes you have the TLExample
model open from the Create Sequence Diagrams Programmatically. You use the move
function to place the first message in the root fragment immediately before the alternative fragment.
Open the Inhibit
sequence diagram.
model = systemcomposer.openModel("TLExample"); diagram = getInteraction(model, "Inhibit");
Get the first and second message in the root fragment.
message = diagram.RootFragment.Operands.Fragments(1).Message; message1 = diagram.RootFragment.Operands.Fragments(2).Message;
Use the RootFragment
property of the interaction to list the classes of all fragments.
iterator = systemcomposer.interaction.Iterator(diagram.RootFragment); next = iterator.next; while ~isempty(next) if isa(next, 'systemcomposer.interaction.AltFragment') altFrag = next; end next = iterator.next; end
Place the message
message immediately before the altFrag
fragment.
if ~isempty(altFrag) move(message, Before=altFrag); end diagram.open;
Input Arguments
More About
Term | Definition | Application | More Information |
---|---|---|---|
Interaction | An interaction specifies how each part of a system should interact as a sequence of message exchanges. | Use interactions to describe operational system behaviors. | Describe System Behavior Using Sequence Diagrams |
Sequence diagram | A sequence diagram is a visual representation of an interaction. | Use sequence diagrams to visually specify how each part of a system should interact. | Describe System Behavior Using Sequence Diagrams |
Lifeline | A lifeline represents an instance of a component as a participant of an interaction. | A lifeline corresponds to a component in an architecture. | Describe Interactions with Lifelines and Messages |
Message | A message represents communication between two lifelines. Messages have labels to specify the expected condition for the message to occur. | A message label has a trigger, an optional guard, and an optional constraint where a trigger represents the identifying event for this message, a guard represents an additional condition to determine whether the message occurs, and a constraint is an expression that is expected to be true when this message occurs. | Describe Interactions with Lifelines and Messages |
Gate | A gate represents the root of an architectural hierarchy. | A gate allows you to describe the exchange of messages between the architecture and its environment. | Describe Interactions with Lifelines and Messages |
Annotation | An annotation describes the elements of a sequence diagram. | Use annotations to provide detailed explanations of elements or workflows captured by sequence diagrams. | Annotate Sequence Diagrams with Annotations |
Fragment | A fragment encloses a group of lifelines and messages within an interaction to allow for the specification of more complex patterns of interaction. | A fragment defines the type of ordering logic such as looping and alternatives. Fragments can have one or more operands. | Model Complex Interactions with Fragments and Operands |
Operand | An operand is a region in a fragment, or group of messages. The condition of an operand specifies whether the messages inside the operand execute. | The condition of an operand can specify constraints on the input signal of a lifeline as a MATLABĀ® Boolean expression. | Model Complex Interactions with Fragments and Operands |
Duration constraint | A duration constraint defines a constraint on elapsed time between a start and an end occurrence. | Use duration constraints to explicitly express a constraint on the duration between a start occurrence and an end occurrence. | Specify Timing Constraints Between Message Events with Duration Constraints |
Version History
Introduced in R2024b
See Also
Tools
Functions
- openViews | sim | addInteraction | getInteraction | getInteractions | open | addLifeline | addFragment | addOperand | addMessage | addDurationConstraint | addAnnotation | findLifeline | findElement | 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.Message | systemcomposer.interaction.Fragment | systemcomposer.interaction.Operand | systemcomposer.interaction.DurationConstraint | systemcomposer.interaction.Annotation