![]() |
![]() |
![]() |
![]() |
![]() |
Comparing and Merging Diagrams
When you select Compare Diagrams or Merge Diagrams from the Tools menu, a dialog will be opened where you can select the SDL diagram to compare with. (It is also possible to compare more than one diagram pair in one operation, but to do this you should use the corresponding menu choices in the Organizer. See Compare > SDL Diagrams and Merge > SDL Diagrams.
Specifying the Diagram to Compare With
There are two ways for specifying the diagram that should be compared with the currently displayed diagram:
- You may specify the file in the Compare with file field.
- You may specify another diagram already opened the SDL Editor in the Compare with editor diagram field. When you click the folder button, a dialog will be opened with a list of all diagrams opened in the SDL Editor (except for the currently displayed).
Selecting the Report Type
In the Compare Diagrams dialog, there are six alternatives for reporting differences between diagrams: Ignore white space and double space in text symbols, Textual Difference Report: Summary, Textual Difference Report: Details, Graphical Difference Report (with Merge Facility) and Select and Print Differences.
The Merge Diagrams dialog does not allow you to get a textual difference report. Instead, you always get a graphical difference report and the only option available is Auto-merge using original file.
Ignore white space and double space in text symbols
When this option is on, differences caused by different usage of white space are ignored when comparing texts. One space character is considered equal to two space characters.
Textual Difference Report: Summary
This option is only available when comparing using the Compare Diagrams menu choice.
A summary of how many differences that has been found is presented in the Organizer log. The summary may look like this:
Comparing /home/lat/x.sprwith /home/lat/y.spr27 differences (16 symbols, 11 lines) :7 changed objects (7 symbols, 0 lines)13 removed objects (6 symbols, 7 lines)7 added objects (3 symbols, 4 lines)When you read this report, notice the following:
- 27 is the total number of found differences in this diagram pair. This is the total of all changed, removed and added objects.
- An object is considered to be changed if you have moved or resized it, or if you have changed a text associated with the object.
If at least one of the two compared diagrams has more than one page, then a summary is also presented for each page pair. It may look like this:
Comparing /home/lat/version1/registeredcard.sptwith /home/lat/version2/registeredcard.spt5 differences (1 symbol, 4 lines) :1 changed object (1 symbol, 0 lines)2 removed objects (0 symbols, 2 lines)2 added objects (0 symbols, 2 lines)Page details:Page ValidateCard5 differences (1 symbol, 4 lines) :1 changed object (1 symbol, 0 lines)2 removed objects (0 symbols, 2 lines)2 added objects (0 symbols, 2 lines)Page RegisterMode0 differencesTextual Difference Report: Details
This option is only available when comparing using the Compare Diagrams menu choice.
This option will print information about each found difference in the Organizer log. This makes it possible to navigate from the Organizer log to every found difference by using the Show Error operation in the Organizer log. See Organizer Log Window.
The detailed textual difference report may look like this:
Comparing /home/lat/d1/db.sbkwith /home/lat/d2/db.sbkComparing page 1#SDTREF(SDL,/home/lat/d1/db.sbk(1),119(50,35))ERROR This symbol has been changed...#SDTREF(SDL,/home/lat/d2/db.sbk(1),119(50,40))ERROR ...and now looks like this.#SDTREF(SDL,/home/lat/d1/db.sbk(1),176(95,60))ERROR This symbol has been removed.#SDTREF(SDL,/home/lat/d2/db.sbk(1),182(60,60))ERROR This line has been added.Graphical Difference Report (with Merge Facility)
The merge facility is only available when merging with the Merge Diagrams menu choice, but you can get a graphical difference report both when comparing with the Compare Diagrams menu choice and when merging with the Merge Diagrams menu choice.
Two SDL Editor windows, named Source 1 and Source 2, displaying the two diagram versions and their differences, and one dialog will be opened. For merge, there will be a third SDL Editor window, named Result, showing the merge result.
- The Compare Diagrams dialog is similar to the Merge Diagrams dialog. The difference is that the Compare Diagrams dialog is missing the first row of buttons. ("<<", Accept1, Accept2 and ">>".)
- In the dialog that will be opened, you can:
- Navigate between difference groups with the Next and Previous buttons.
- (Merge Diagrams only.) Navigate between unresolved (not-yet merged) difference groups with the "<<" and ">>" buttons.
- (Merge Diagrams only.) Do a merge, i.e. update the merge result diagram with information from the current difference group and one of the compared diagram versions, with the Accept1/Reject1 and Accept2/Reject2 buttons.
- Compare or merge a text in a text symbol in the current difference group.
- Print the current difference found in the current page pair.
Comparing text in text symbols
When two text symbols differ the CompareText button will be available in the Compare Diagrams dialog and it will be possible to enter the Compare Text Symbols dialog.
The Compare Text Symbols dialog consists of two lists of text that are placed side by side with a "gutter" that will contain extra information about the differences. This gutter-information consist of:
The current difference is indicated with a highlight. Buttons make it possible to navigate to Previous and Next difference item.
Merging text in text symbols
When manual merges are conducted the option to merge text symbols will always be available in the Merge Diagrams dialog. When merging a MergeText button is available as in the compare function. When a text symbol is selected there will be an option to select either symbol or merge the text in the symbols into a new symbol.
If the text merge is selected a Merge Text Symbols dialog is presented with three text lists, the two source texts and the result text. It is possible to navigate between the unresolved differences or between all differences.
This works in the same way as in the normal merge. The buttons "<<" and ">>" will jump between the unresolved differences and the Previous and Next buttons will jump between all differences.
The use of Accept 1/Reject 1, Accept 2/Reject 2 buttons will select neither, either or both the texts for merge. The selections from the source files are presented in the result-list the gutter will show what version is selected. Additional symbols in the result list are:
It is also possible to edit the result line-by-line by selecting a line and edit it below the list. Clicking the Change button will replace the changed line in the result list.
Ignore moved or resized objects
If this option is on, the compare operation tries to ignore differences only caused by moved or resized symbols. You should only use this option if the two compared diagrams originates from the same diagram. (For instance, you have used Save as on the original diagram to get the second copy.) This option will not work well if you create two diagrams from scratch and compare them, because the operation uses object IDs to match moved or resized objects.
Select and Print Differences
If this option is on and there are differences, then a print dialog will pop up when the first dialog is closed. Only SDL diagram pages containing differences will be printed, and the differences will be highlighted with selection markers. If the same page containing differences can be found in both compared diagrams, then the two pages will be printed after each other, beginning with the page from the diagram that was visible in the editor when the compare operation was invoked.
Auto-merge using original file
This option is only available in the Merge Diagrams dialog. It allows you to specify the original diagram file that both the diagram versions that are compared originates from. If you specify the original diagram file, then the merge operation can auto-merge all non-conflicting changes for you. Note that if you give the wrong original diagram, then the auto-merge operation may merge the two versions in the wrong way. If you do not specify an original diagram, then the merge operation leaves all merging of differences to you.
Differences That Will Be Reported
When you use Compare Diagrams or Merge Diagrams, all visual object differences will be found:
- An object that has been moved, resized, removed, added or painted in a different color.
- A text, associated with an object, that has been changed
An object is considered to be moved if it has been moved relative to the upper left corner of the diagram frame. This means that if you move the frame, it will have no effect.
Diagrams are compared one page pair at a time. A page pair is one page from the original diagram and one page from the other diagram where both pages have the same name. If there is no page with the same name in the other diagram, then the complete page is considered to be a difference.
Difference Groups
Differing objects from the same page pair are grouped into difference groups. Two differing objects are placed in the same group if:
- The objects are from the same diagram and they are connected to each other. For instance, a flow line connected to a task symbol.
- The objects are from different diagrams and they would overlap if they were in the same diagram, that is, it would be impossible to place the two objects in the same diagram without changing the position within the diagram for one of them.
- The objects are from different diagrams and the difference operation can conclude that it is the same object that has been moved.
Color and the Current Difference Group
In the graphical difference report, all differing objects are given temporary background colors as specified in the initial dialog. As default, the color is green in the original diagram and magenta in the other diagram. Temporary colors are not saved in diagram files. How temporary colors are removed is described in Temporary Colors > Remove.
The dialog that will be opened during the graphical difference report, allows you to navigate between difference groups using previous and next buttons. All objects in the current difference group are selected.
Normally, version 1 of the compared diagrams (the diagram that was in the SDL editor when the compare operation was invoked) is shown in a window in the top left corner of the screen. Version 2 (the diagram that was specified in the first compare dialog) is shown in the top right corner off the screen. For complete page differences (a difference where a page can not be found in the other diagram), the window that misses the page is hidden.
Note that it is possible to manually edit the compared diagrams while the compare operation is ongoing. This can be seen as a light-weight alternative to the full merge operation (described next).
Merging
During a merge operation, three windows are used in addition to the second merge dialog:
- The top left corner of the screen is used to show version 1 of the compared diagrams, in the editor window named Source 1. This is the diagram that was visible in the SDL editor window when the merge operation was invoked.
- The bottom left corner of the screen is used to show version 2 of the compared diagrams, in the editor window named Source 2. This is the diagram that was specified in the first merge dialog as the diagram to compare with.
- The right part of the screen is used to show the merge result diagram, in the editor window named Result. This is a new diagram that has been created from the two compared diagram versions.
The second Merge dialog does not only have previous and next buttons to navigate between differences. It does also have Accept/Reject buttons and "<<" (fast backward) / ">>" (fast forward) buttons.
- Pressing Accept 1 (2) will add symbols to the merge result diagram. It is the symbols from version 1 (2) of the current difference group that will be added.
- Pressing Reject 1 (2) will remove symbols from the merge result diagram. It is the symbols that can be found in version 1 (2) of the current difference group that will be removed.
- Pressing "<<" (fast backward) will navigate to the previous unresolved difference group. An unresolved difference group is a difference group where both version 1 and version 2 are not accepted.
- Pressing ">>" (fast forward) will navigate to the next unresolved difference group.
Note that it is possible to manually edit diagrams while a merge operation is ongoing. This can be useful if you want the merge result diagram to look different from both version 1 and version 2 of the compared diagrams.
When the second merge dialog is closed, the editor will ask you to save the merge result by displaying a save dialog above the window with the merge result diagram buffer. When the save dialog is closed, the editor windows are restored to how they appeared before the merge operation was invoked.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |