Synchronize Sequence Diagrams and Architecture Models
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.

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.

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.

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.

Push Changes from Sequence Diagram to Architecture Model
1. Open the CreateInArchitecture sequence diagram. In the View Browser, select CreateInArchitecture.

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.

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.

Retarget Lifeline and Create New Connection in Architecture Model
1. Open the RetargetThenCocreate sequence diagram. In the View Browser, select RetargetThenCocreate.

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

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.

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

See Also
Tools
Functions
openViews|sim|addInteraction|getInteraction|getInteractions|open|addLifeline|addFragment|addOperand|addMessage|addDurationConstraint|addAnnotation|findLifeline|findElement|move|move|move|destroy|next|current|reset
Objects
systemcomposer.arch.Model|systemcomposer.interaction.Interaction|systemcomposer.interaction.Iterator|systemcomposer.interaction.Lifeline|systemcomposer.interaction.MessageEvent|systemcomposer.interaction.FormalGate|systemcomposer.interaction.Message|systemcomposer.interaction.Fragment|systemcomposer.interaction.Operand|systemcomposer.interaction.DurationConstraint|systemcomposer.interaction.Annotation