Main Content

Synchronize Sequence Diagrams and Architecture Models

Since R2022a

This example shows how to maintain consistency between an architecture model and the corresponding sequence diagrams. The co-creation workflow updates the architecture model based on changes you make in sequence diagrams. When elements are out of sync, you can use the synchronization workflow to check consistency.

The software highlights any inconsistent elements in the sequence diagram. In this example, you learn how to resolve highlighted inconsistencies by:

  • Pulling changes from an architecture model to a sequence diagram

  • Pushing changes to an architecture model from a sequence diagram

Open the architecture model and the Architecture Views Gallery.

model = systemcomposer.openModel("mRetargetElements");
openViews(model);

Pull Changes from Architecture Model to Sequence Diagram

1. Open the RepairExample sequence diagram. In the View Browser, select RepairExample. In the diagram, select the ChildComponent lifeline.

View Browser of the Architecture Views Gallery with the RepairExample sequence diagram selected.

2. In the architecture model, select the ChildComponent component. Pause on the ellipsis (...) that appears and select Create Component. Specify the name of the new component as Component. The ChildComponent component is now the child of the Component component.

The ChildComponent is selected and the cursor is hovering over the 'Create Component' option in the ellipses menu.

3. From the Architecture Views Gallery, on the toolstrip, in the Synchronize section, click Check Consistency. The software highlights the ChildComponent lifeline because the ChildComponent component is no longer at the root level of the architecture model. Hover over the yellow warning icon to display the message.

The RepairExample sequence diagram with the ChildComponent lifeline highlighted in yellow.

4. To resolve this inconsistency, you can create a new ChildComponent in the architecture by clicking Create in Architecture. Alternatively, you can select the ChildComponent lifeline and click Repair sequence diagram. In this case, the software updates the RepairExample sequence diagram by pulling changes from the mRetargetElements architecture model and adding the Component component as a lifeline.

The RepaitExample sequence diagram with the Component and ChildComponent lifelines.

Push Changes from Sequence Diagram to Architecture Model

1. Open the CreateInArchitecture sequence diagram. In the View Browser, select CreateInArchitecture.

View Browser of the Architecture Views Gallery with the CreateInArchitecture sequence diagram selected.

2. The DoesNotExistSrc and DoesNotExistDst lifelines do not have corresponding components in the mRetargetElements architecture. To maintain consistency, select the two lifelines and the message of the sequence diagram. Then, on the toolstrip, click Create in Architecture.

The CreateInArchitecture sequence diagram with the DoesNotExistSrc and DoesNotExistDst lifelines and a message selected.

3. The software updates the mRetargetElements architecture model by pushing changes from the CreateInArchitecture sequence diagram and adding the DoesNotExistSrc and DoesNotExistDst components to the architecture.

The DoesNotExistSrc and DoesNotExistDst components connected with the Src and Dst ports.

Retarget Lifeline and Create New Connection in Architecture Model

1. Open the RetargetThenCocreate sequence diagram. In the View Browser, select RetargetThenCocreate.

View Browser of the Architecture Views Gallery with the RetargetThenCocreate sequence diagram selected.

2. Select the B lifeline on the sequence diagram. On the toolstrip, in the Synchronize section, set Architecture Element to C.

View Browser of the Architecture Views Gallery with the RetargetThenCocreate sequence diagram open. The Architecture Element field dropdown menu is expanded and the C option is selected.

3. The software highlights the message between the A and C lifelines because the A and C components are not connected in the architecture model. Hover over the yellow warning icon to display the message.

The RetargetThenCocreate sequence diagram with the message highlighted in yellow.

4. To resolve this inconsistency, click Create in Architecture. The software updates the mRetargetElements architecture model by creating a new connection.

Two architecture models side by side. In the model on the left, Component A and Component B are connected. Component C has no connections. In the model on the right, Component A and Component B are connected. Component C is connected to Component A.

See Also

Tools

Functions

Objects

Topics