Behavioral Diagrams: Sequence Diagrams

SysML Behavioral Diagram Types

Behavioral Related

5. Use Case Diagrams (uc)

6. Activity Diagrams (act)

7. State Machine Diagrams (stm)

8. Sequence Diagrams (seq)

9 SysML Diagrams Taxonomy: Highlighting SysML Sequence (seq) Diagrams

Sequence Diagrams (seq)

What is a SysML Sequence diagram?  Several Different Definitions from the Experts


Definitions

Sequence diagram (sd): A Sequence diagram is a dynamic behavioral diagram that shows interactions (collaborations) among distributed objects or services via sequences of messages exchanged, along with corresponding (optional) events.


Source & More Info

A Sequence diagram is a type of Interaction diagram that shows the time ordered interaction between objects. The diagram has two axes; the vertical axis represents time and the horizontal axis represents the objects that take part in the interaction, typically ordered in a way that best illuminates the interaction. These diagrams have their origin in the modeling of software interactions, but they can be used with systems engineering to be prescriptive of how elements (such as Blocks) should interact, or descriptive in showing how they do interact, in practice.

Sequence Diagram (seq) Example

SysML Behavior Diagram: Sequence (seq) Diagram Bank Deposit Example Made in Cameo

In this example, there are 3 lifelines which are the parts interacting in the behavior.  Lifelines are always structural elements.  In this example the lifelines are part properties, atm:ATM, consortium:Consortium, and bank:Bank. 

1. verifyCard() is an operation which occurs 1st in the sequence.  The numbers are automatically made by Cameo. (Note this is a setting which can be applied so if you don't see the number's don't worry)

The {100} underneigth 1. verifyCard is a duration constraint which indicates how long in time between step 2 and step 1. 

The filled in arrow shown in step 1. verifyCard means atm:ATM is expecting a response in the future, which happens with the dotted line in step 4. reply verifyCard. 

Logic (combined fragments) can be added to sequence diagrams for repeating/looping events and conditional events.  This logic is depicted by a rectangle.  There are no logical elements within the example.

When to use a Sequence Diagram

A sequence diagram should be used within SysML when you need to model the flow of events and messages between two or more objects in a system. Sequence diagrams are useful for modeling scenarios and analyzing interaction scenarios between objects. They can be used to model the sequence of events in a system, identify potential issues, and analyze the behavior of objects. They are particularly useful for modeling the order of events or trying to show relative times of events.  

---------

Other Sources

Sequence diagrams can be used to represent system scenarios showing how parts of a system interact together to achieve some specified outcome. Messages are said to be exchanged between lifelines representing the lifetime of the object, the messages represent operations or signals sent and received by the objects.

Source & More Info

What is the Purpose of the Sequence Diagram

The purpose of Sequence diagrams is to specify dynamic system behaviors as message-passing collaborations among prototypical Blocks (Parts). When properly applied (See Usage Notes below) Activity diagrams are recursively scalable and simulatable.

Sequence diagrams in SysML are used to model interactions between objects over time. They are used to visualize a system's behavior and its interactions with other parts of the system. Sequence diagrams are used to identify and analyze the behavior of the system, including the order of operations, the timing of events, and the flow of control between objects. They can also be used to identify potential problems and conflicts in the system's behavior. 

Cameo seq Toolbar

Cameo Sequence (seq) Diagram Vertical Toolbar

Elements of a Sequence Diagram

Lifeline

A lifeline is a representation of an object or an actor in a sequence diagram. It is represented as a vertical dashed line and is used to illustrate the interactions between objects/actors. It also shows the timeline of an object/actor’s activities. 

Message

A message is a communication between two objects/actors in a sequence diagram and is represented as an arrow pointing from one object/actor to another. There are several different message types used within SysML sequnece diagrams most frequently. 

Combined Fragment

A combined fragment is a combination of messages to represent the flow of control in the system. It is represented as a rectangle with a dotted line. 

Constraint

A constraint is a condition or restriction that can be applied to a message such as a duration constraint.

----------------

Information From Other Sources

Message: A Message (notation: arrow) represents communication from one object to another, with the expectation that a useful behavior will ensue. Messages may be synchronous (notation: open arrowhead) or asynchronous (notation: black-triangle arrowhead).

Elements

The main elements that can appear in Parametric diagrams are:

The main connectors that can appear in Parametric diagrams are:


Source & More Info

Several More Sequence Diagram Example

We can see below how lifelines can be created (see :Order").  They can also be destroyed.  

Additionally, we see the logical combined fragment rectangles on the diagram.  All elements such as the messages which occur within the combine fragment rectangle are within the scope of the logic the combined fragment applies.

See https://docs.nomagic.com/display/MD190/Combined+Fragment for additional details.

SysML Sequence (seq) Diagram Order Ticket Example with Loop Logic Made in Cameo

The coloring scheme of the diagram above is the SysML representation within the Cameo tool.  The diagram below is  an excerpt from "OMG Systems Modeling Language (OMG SysML) Version 1.4Download the book here.  For more helpful resources, go here.

SysML Sequence (seq) Diagram Start Vehicle Example