Main Content

Describe System Behavior Using Sequence Diagrams

You can use sequence diagrams integrated with System Composer™ to describe system behaviors as the interaction between components in a sequence of message exchanges. When you author sequence diagrams, you can:

  • Add lifelines to represent components in an architecture and create child lifelines to represent child components.

  • Add messages between lifelines which represent a connection between component ports. Use message labels to describe how lifelines interact with each other.

  • Interact with root architecture ports in a sequence diagram using gates.

  • Co-create components, ports, and connections in your architecture model as you author new lifelines and messages in the sequence diagram.

  • Add fragments and operands to group messages and implement more complicated semantics like conditionals or looping.

  • Iteratively check consistency between your architecture model and the corresponding sequence diagrams.

  • Describe interactions between client and server components using call and response messages with software architectures. For more information, see Describe Client-Server Interactions Using Sequence Diagrams.

Author sequence diagrams labeled.

These concepts are relevant for authoring sequence diagrams:

  • 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.

  • 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.

  • 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.

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

    Connect messages to gates to represent architecture ports.

  • An annotation describes the elements of a sequence diagram.

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

  • 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.

  • 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.

Create New Sequence Diagram

To create a new sequence diagram:

  1. To open sequence diagrams in the Architecture Views Gallery, navigate to Modeling > Sequence Diagram.

  2. To create a new sequence diagram, click New > Sequence Diagram.

  3. A new sequence diagram called SequenceDiagram1 is created in the View Browser, and the Sequence Diagram tab becomes active. Under Sequence Diagram Properties, you can rename the sequence diagram.

Alternatively, you can use the addInteraction function to create a new sequence diagram.

Author, Simulate, and Validate Sequence Diagrams

Sequence diagrams are integrated with architecture models in System Composer. While designing your system, use sequence diagrams as a planning tool to envision your system and later validate that your system works as designed. You can also simulate and validate sequence diagrams help you to validate an expected sequence of events as system design proceeds.

TopicDescription
Author Sequence Diagrams InteractivelyInteractively create and edit a sequence diagram and learn terminology.
Author Sequence Diagram FragmentsLearn how to implement fragments and more about fragment semantics.
Author Sequence Diagrams to Co-Create Architecture ModelsCreate and use sequence diagrams with architecture models.
Synchronize Sequence Diagrams and Architecture ModelsLearn how to synchronize sequence diagrams with architecture models.
Simulate Sequence Diagrams for Traffic Light ExampleSimulate a sequence of message exchanges as interactions between lifelines.
Author and Simulate Basic Colors Sequence Diagram with EnumerationsAuthor and simulate a sequence diagram containing a basic colors enumeration class.

Tip

To learn more about how System Composer concepts apply to systems engineering design, see System Composer Concepts.

See Also

Tools

Functions

Objects

Related Topics