findElement - Find element in interaction - MATLAB (original) (raw)
Main Content
Find element in interaction
Since R2024b
Syntax
Description
[element](#mw%5F27268cf5-732e-4f68-8707-bfcd2109b5ea%5Fsep%5Fmw%5Fc702f1db-2ded-47c7-bf6c-0dd33bc85ddd) = findElement([interaction](#mw%5F27268cf5-732e-4f68-8707-bfcd2109b5ea%5Fsep%5Fmw%5F91e5b2bb-cf28-4f8d-bb2b-48061211fa8f),[UUID](#mw%5F27268cf5-732e-4f68-8707-bfcd2109b5ea%5Fsep%5Fmw%5F5b84c380-139d-41ee-a10f-6e470b7f8bcf))
uses the UUID to find elements in a sequence diagram that correspond to the interactioninteraction
.
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
Add a lifeline to the sequence diagram.
lifeline = interaction.addLifeline(comp);
Find a lifeline by name in the sequence diagram.
lifelineFound = interaction.findLifeline(Name="Component")
lifelineFound =
Lifeline with properties:
Name: 'Component'
FullPath: 'archModel/Component'
Parent: [0×0 systemcomposer.interaction.Lifeline]
Children: [0×0 systemcomposer.interaction.Lifeline]
RelatedElements: [1×1 systemcomposer.arch.Component]
UUID: '6e96667a-c5a9-4480-90cc-808f6ebd46e4'
ExternalUID: ''
Find a lifeline by UUID in the sequence diagram.
lifelineFoundByUUID = interaction.findElement(lifelineFound.UUID)
lifelineFoundByUUID =
Lifeline with properties: externalUID: '' name: 'Component' backendElements: [1×1 sequencediagram.lang.syntax.BackendElement Sequence] parent: [1×0 sequencediagram.lang.syntax.Lifeline] children: [1×0 sequencediagram.lang.syntax.Lifeline Set]
Input Arguments
Universal unique identifier, specified as a character vector.
Example: '91d5de2c-b14c-4c76-a5d6-5dd0037c52df'
Data Types: char
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 | addInteraction | getInteraction | getInteractions | open | addLifeline | addFragment | addOperand | addMessage | addDurationConstraint | addAnnotation | findLifeline | 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