addInteraction - Create new sequence diagram in model - MATLAB (original) (raw)
Main Content
Create new sequence diagram in model
Since R2024b
Syntax
Description
[interaction](#mw%5F4819b023-181d-4b38-8030-505ee2a6b503%5Fsep%5Fmw%5Fca95e2c5-a7b9-45d2-8675-073109d463d9) = addInteraction([model](#mw%5F4819b023-181d-4b38-8030-505ee2a6b503%5Fsep%5Fmw%5Fdd2259b7-0f28-413e-85ff-5c2d31dc8c7f),[name](#mw%5F4819b023-181d-4b38-8030-505ee2a6b503%5Fsep%5Fmw%5F8c9dd666-8ea6-4e47-91e6-d0b7665b2ffe))
creates a sequence diagram in a System Composerâ„¢ model.
[interaction](#mw%5F4819b023-181d-4b38-8030-505ee2a6b503%5Fsep%5Fmw%5Fca95e2c5-a7b9-45d2-8675-073109d463d9) = addInteraction([model](#mw%5F4819b023-181d-4b38-8030-505ee2a6b503%5Fsep%5Fmw%5Fdd2259b7-0f28-413e-85ff-5c2d31dc8c7f),[name](#mw%5F4819b023-181d-4b38-8030-505ee2a6b503%5Fsep%5Fmw%5F8c9dd666-8ea6-4e47-91e6-d0b7665b2ffe),CopyFrom=[copyFrom](#mw%5F5507215e-3919-4bd4-9ea0-9d25e7e89896))
creates a copy of the interaction
sequence diagram inmodel
model with name
name.
Examples
Create a model with a component called Component
.
model = systemcomposer.createModel("archModel"); systemcomposer.openModel("archModel"); arch = get(model,"Architecture"); comp = addComponent(arch,"Component");
Create a sequence diagram in the model, and then open the sequence diagram.
interaction = model.addInteraction("NewSequenceDiagram"); interaction.open
Input Arguments
Name of interaction, specified as a character vector or string.
Example: "inhibit"
Data Types: char
| string
Output 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 | 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.Message | systemcomposer.interaction.Fragment | systemcomposer.interaction.Operand | systemcomposer.interaction.DurationConstraint | systemcomposer.interaction.Annotation