Main Content

findElement

Find element in interaction

Since R2024b

    Description

    element = findElement(interaction,UUID) uses the UUID to find elements in a sequence diagram that correspond to the interaction interaction.

    example

    Examples

    collapse all

    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

    collapse all

    Interaction, specified as a systemcomposer.interaction.Interaction object.

    Universal unique identifier, specified as a character vector.

    Example: '91d5de2c-b14c-4c76-a5d6-5dd0037c52df'

    Data Types: char

    Output Arguments

    collapse all

    More About

    collapse all

    Definitions

    TermDefinitionApplicationMore Information
    sequence diagram

    A sequence diagram represents the expected interaction between structural elements of an architecture as a sequence of message exchanges.

    Use sequence diagrams to describe how the parts of a system interact.

    Describe System Behavior Using Sequence Diagrams
    lifeline

    A lifeline is represented by a head and a timeline that proceeds down a vertical dotted line.

    The head of a lifeline represents a component in an architecture model.

    Add Lifelines and Messages
    message

    A message sends information from one lifeline to another. Messages are specified with a message label.

    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.

    Create Messages in Sequence Diagram
    gate

    A gate represents the root architecture of the corresponding architecture model.

    Connect messages to gates to represent architecture ports.

    Create Sequence Diagram Gates
    annotation

    An annotation describes the elements of a sequence diagram.

    Use annotations to provide detailed explanations of elements or workflows captured by sequence diagrams.

    Use Annotations to Describe Elements of Sequence Diagram
    fragment

    A fragment indicates how a group of messages execute or interact.

    A fragment is used to model complex sequences, such as alternatives, in a sequence diagram.

    Author Sequence Diagram Fragments
    operand

    An operand is a region in a fragment. Fragments have one or more operands depending on the kind of fragment. Operands can contain messages and additional fragments.

    Each operand can include a constraint to specify whether the messages inside the operand execute. You can express the precondition of an operand as a MATLAB® Boolean expression using the input signal of a lifeline.

    Add Fragments and Operands

    Version History

    Introduced in R2024b