Compare Sequence Diagram Differences Using System Composer Comparison Tool
This example shows how to use the System Composer Comparison Tool to compare two System Composer™ sequence diagrams with differences in diagram elements. You can compare sequence diagrams to generate a comparison report that includes added or deleted sequence diagrams and shows differences between diagram elements such as lifelines, fragments, operands, messages, annotations, and duration constraints.
In this example, the sequence diagrams describe scenarios related to a pedestrian crossing an intersection with traffic lights. For more information about authoring sequence diagrams, see Author Sequence Diagrams Interactively.
Open System Composer Comparison Tool
To compare sequence diagrams, create comparison reports for the architecture models that contain the sequence diagrams. In this example, you can compare the original version of the SequenceDiagramComparisons
model with the SequenceDiagramComparisonsEdited
model.
To open the System Composer Comparison Tool, enter this command.
visdiff("SequenceDiagramComparisons.slx","SequenceDiagramComparisonsEdited.slx");
Alternatively, from the Files panel, select the two model files, right-click, and select Compare Selected Files/Folders.
Understand Sequence Diagram Comparison Changes
Review the comparison report to explore the differences in your sequence diagrams. In this example, the comparison report only displays differences between diagram elements of the sequence diagrams associated with the architecture models. These differences are displayed in the Sequence Diagrams
section of the report.
The comparison report highlights rows according to the type of difference:
Insertion
— Added elements to the right side that did not exist on the left side
Deletion
— Removed elements that did exist on the left side but not on the right side
Modification
— Changes to existing elements that exist on both the left and right sides
Compare Diagram Element Differences
The Sequence Diagrams
section of the System Composer comparison report includes changes to lifelines, fragments, operands, messages, annotations, and duration constraints.
In this report, the tool selects the Inhibit_v1 node and shows the details in a pane on the bottom of the report. In the details pane, the modified Name is colored in purple. You can see that the name property of the diagram was modified to be Inhibit_v2
in the SequenceDiagramComparisonsEdited
model.
To step through the differences, on the Comparison tab, in the Navigate section, use the Next and Previous buttons. Alternatively, use the up and down arrows on your keyboard to navigate the report.
In this report, the tool selects the Annotation node, which is colored in yellow to represent the deletion of this element. You can see that the context and UUID properties of the annotation are deleted in the SequenceDiagramComparisonsEdited
model.
Click Next again. The tool selects the Duration Constraint node, which is colored in blue to represent the insertion of this element. You can see that the duration constraint element and properties are inserted in the SequenceDiagramComparisonsEdited
model.
Click Next one more time. The tool selects the message label, which is highlighted in purple to represent the modification of this element. You can see that the condition property of the message label was modified to be rising(sw-1){sw==1}
in the SequenceDiagramComparisonsEdited
model.