Comparing two Mappings
General concept #
Manual/visual comparison of graphical ADH mappings is cumbersome.
The ‘mapping comparison’ feature will list differences between two mappings (two different mappings, or two revisions of the same mapping) for these items:
- Output Pattern fields and groups
- Transformation blocks and their properties
- Connections
- Input Pattern fields and groups
- Output Pattern XSL (XML mappings only)
- Mapping Detail properties
- Automatic Corrections
Double-clicking any difference belonging to the first 4 categories will highlight that difference in the ‘source’ and ’target’ mapping graphical editor.
If the target mapping is in edit mode, any change made to the target mapping will trigger a re-calculation of the differences.
Use case #
I am viewing or editing a ’target’ mapping M in window W1. I select a menu option to compare this mapping against another mapping (the ‘source’).
The other mapping may be a different revision/version of M, or it may be a different mapping M2.
Once the source mapping is established, the ADH graphical editor for the source mapping opens in view mode in a window W2 separate from W1.
In addition, a third window W3 (the ‘comparison’ window) opens, listing the differences between the source and target mappings.
It will be possible to make changes in the target window W1 if this window is in edit mode (this is existing functionality). Such changes will trigger a re-calculation of the list of differences between the source and target mappings, and an update of the comparison window.
Differences will be established for the following components.
Output Pattern(s) #
First, for the ‘Transformation’ tab, the used Output Patterns are matched by name between the source and target mappings. If an Output Pattern used in the target mapping is (to the human observer) essentially the same as an OP used in the source mapping, but differently named, then this will be considered a difference, unless the contents are identical. To be more precise:
1st, match and remember equally named Output Patterns (actually, Output Structures). If both mappings have two or more equally named Output Patterns, there will be a random matching. For each matched OP pair, the ‘used’ OP groups (those with an incoming connection on one or more descendant OP non-group fields) of the source/target will be checked for: same path, same mandatory flag, same repeatable flag, same Output Structure offset. Differences will be reported. Then, the ‘used’ OP non-group fields (those with an incoming connection) of the source/target will be checked for: same path, and same mandatory flag. Differences will be reported.
2nd, remaining Output Patterns will have different names. Those with equal content w.r.t. ‘used’ fields (see first step) are OK.
3rd, remaining Output Patterns will have different names and different content. They may also be different in numbers. If there is exactly one source OP and one target OP in this category, these will be paired and checked for OP field differences. Else, report the Output Patterns in this cateogry as name difference(s) without detailing OP field differences.
Output Pattern fields, Connections, Blocks, Block Properties, Input Pattern fields #
For each matching OP pair (source/target mapping), the OutputPattern (actually, Output Structure) contents will be checked.
For each OP non-group field that exist in the same position (actually, ‘with the same path’, as the sequence within a group is not relevant) in source and target AND which is ‘in use’ in both or either OP, there will be a ’trace-back’ of connections, blocks, block properties and Input Pattern fields, right-to-left.
If an OP field F has different trace-backs in the source and target mappings, this will constitue one or more difference(s). When selecting such a specific difference in the comparison window, the existing ‘Show Data Path Only’ will be applied to the source OP field as well as the target OP field. The differing connections and/or blocks and/or Input Pattern fields (position (actually, ‘with the same path’, as the sequence within a group is not relevant) and/or name) will be highlighted in the source and target windows. For differences in block properties, the block will be highlighted.
If an OP field exists only in the OP revision used in the source (target) mapping, the corresponding trace-back will be highlighted in the source (target) mapping window only.
Trace-backs (and possible differences) will also be established for ’terminal’ blocks, that is, blocks that have no outgoing connections and hence are not connected to any OP field. This applies to the Error (fixed) block, the Gate (master) block and the Sort block.
All of the above applies to the ‘Transformation’ tab. The ‘Validation’ tab cannot have an OP, so only terminal blocks will be checked.
Input Pattern fields #
XML mappings #
All IP groups of the source/target will be checked for: same path (including name), same xPath, same mandatory flag, same repeatable flag. All IP non-group fields of the source/target will be checked for: same path (including name), same xPath, same mandatory flag, same forbidden flag. Differences will be reported.
Tabular mappings #
All IP groups of the source/target will be checked for: same path (including name), same mandatory flag, same repeatable flag. All IP non-group fields of the source/target will be checked for: same path (including name), same mandatory flag, same forbidden flag, same type/size/subSize. Differences will be reported.
Output Pattern XSL #
XML mappings only:
If the XSL transform of the source and target mapping differs in any way (including insignificant formatting differences), it will be recorded as a difference. When selecting such a difference in the comparison window, there will be no visual highlighting in the source and target windows.
Mapping Detail #
If the ‘Mapping detail’ data of the source and target mapping differ in any way, it will be recorded as a difference. When selecting such a difference in the comparison window, there will be no visual highlighting in the source and target windows.
Automatic Corrections #
If the automatic correction lists of the source and target mapping differ in any way, it will be recorded as a difference. When selecting such a difference in the comparison window, there will be no visual highlighting in the source and target windows.
Not compared #
The mapping names will not be compared.
The mappings statuses (active/inactive) and valid flag (yes/no) will not be compared.
The note fields will not be compared.
The x/y-position of transformation blocks and Output Patterns will not be compared.
Restrictions #
The source and target mappings must be of the same type (XML or Tabular).