Main Content

Synchronize Sequence Diagrams and Architecture Models

Since R2022a

This example shows how to maintain consistency between sequence diagrams and an architecture model.

Open the model.

model = systemcomposer.openModel("mRetargetElements");

Open the Architecture Views Gallery.

openViews(model)

Pull Changes from Architecture Model to Sequence Diagram

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

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

2. Return to the model canvas. Marquee select the ChildComponent component. Pause on the ellipses (...) menu and select Create Architecture. Specify the name of the new component as Component. The ChildComponent component is now the child of the Component component.

Component named Component with a child component inside of it.

3. Click Check Consistency on the sequence diagram RepairExample. The sequence diagram has become inconsistent and the ChildComponent lifeline is highlighted because it is no longer at the root level of the diagram.

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

4. Select the ChildComponent lifeline and, on the toolstrip, click Repair. The sequence diagram RepairExample is updated after changes are pulled from the architecture model mRetargetElements.

The RepaitExample sequence diagram with the Component and ChildComponent lifelines.

Push Changes from Sequence Diagram to Architecture Model

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

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

2. Marquee select the contents of the sequence diagram, including the two lifelines and the message.

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

3. In the toolstrip, click Create in Architecture. The architecture model mRetargetElements is updated after changes are pushed from the sequence diagram.

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

Retarget Lifeline and Create New Connection in Architecture Model

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

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

2. Select the B lifeline on the sequence diagram and, from the Architecture Element menu, select C from the list. The sequence diagram becomes inconsistent, and the message is highlighted.

The RetargetThenCocreate sequence diagram with the message between lifeline A and lifeline C highlighted in yellow.

3. Select the message and, in the toolstrip, click Create in Architecture. A new connection is created in the architecture model mRetargetElements.

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