同步序列图和架构模型
自 R2022a 起
此示例展示了如何保持序列图与架构模型之间的一致性。
打开模型。
model = systemcomposer.openModel("mRetargetElements");
打开架构视图库。
openViews(model)
将更改从架构模型拉到序列图
1.在视图浏览器中,选择 RepairExample
序列图。检查名为 ChildComponent
的生命线。
2.返回模型画布。选中 ChildComponent
组件。在省略号 (...) 菜单上暂停,然后选择 Create Architecture
。将新组件的名称指定为 Component
。ChildComponent
组件现在是 Component
组件的子组件。
3.点击序列图 RepairExample
上的检查一致性。序列图已变得不一致,并且 ChildComponent
生命线被突出显示,因为它不再位于图的根级别。
4.选择 ChildComponent
生命线,然后在工具栏上点击修复。从架构模型 mRetargetElements
中提取更改后,序列图 RepairExample
也会随之更新。
将序列图中的更改推送到架构模型
1.在视图浏览器中,选择 CreateInArchitecture
序列图。
2.选框选择序列图的内容,包括两条生命线和消息。
3.在工具栏中,点击在架构中创建。从序列图推送更改后,架构模型 mRetargetElements
也会随之更新。
在架构模型中重新定位生命线并创建新连接
1.在视图浏览器中,选择 RetargetThenCocreate
序列图。
2.在序列图上选择 B
生命线,然后从架构元素菜单中选择列表中的 C
。序列图变得不一致,消息被高亮显示。
3.选择消息,然后在工具栏中点击在架构中创建。在架构模型 mRetargetElements
中创建了一个新连接。
另请参阅
工具
函数
openViews
|sim
|addInteraction
|getInteraction
|getInteractions
|open
|addLifeline
|addFragment
|addOperand
|addMessage
|addDurationConstraint
|addAnnotation
|findLifeline
|findElement
|move
|move
|move
|destroy
|next
|current
|reset
对象
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