Synchronize Sequence Diagrams and Architecture Models
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
.
2. Return to the model canvas. Marquee select the ChildComponent
component. Pause on the ellipses (...) menu and select Create Subsystem
. Specify the name of the new component as Component
. The ChildComponent
component is now the child of the Component
component.
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.
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
.
Push Changes from Sequence Diagram to Architecture Model
1. In the View Browser, select the CreateInArchitecture
sequence diagram.
2. Marquee select the contents of the sequence diagram, including the two lifelines and the message.
3. In the toolstrip, click Create in Architecture. The architecture model mRetargetElements
is updated after changes are pushed from the sequence diagram.
Retarget Lifeline and Create New Connection in Architecture Model
1. In the View Browser, select the RetargetThenCocreate
sequence diagram.
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.
3. Select the message and, in the toolstrip, click Create in Architecture. A new connection is created in the architecture model mRetargetElements
.
See Also
Tools
Functions
openViews
|sim
|addInteraction
|getInteraction
|getInteractions
|open
|addLifeline
|addFragment
|addOperand
|addMessage
|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.RootFragment
|systemcomposer.interaction.AltFragment
|systemcomposer.interaction.OptFragment
|systemcomposer.interaction.LoopFragment
|systemcomposer.interaction.SeqFragment
|systemcomposer.interaction.StrictFragment
|systemcomposer.interaction.ParFragment
|systemcomposer.interaction.Operand
|systemcomposer.interaction.Annotation
|Simulink.SimulationInput
|Simulink.SimulationOutput
Related Topics
- Overview of System Composer API
- Describe System Behavior Using Sequence Diagrams
- Pivot Between Lifelines and Components in Views Gallery
- Compose Architectures Visually
- Implement Component Behavior Using Simulink
- Implement Component Behavior Using Stateflow Charts
- Implement Component Behavior Using Simscape