The concept of multiple mapping is the idea that you need to map a single, flat structure to a structure that is hierarchical in nature, with lower segments containing multiple sets of values, such as name/value pairs. In this circumstance, copies of a particular folder may occur many times, each folder copy must be mapped with appropriate rules.
A sample situation is provided below to illustrate how to achieve flat-to-hierarchical transformations.
Consider the situation where the source of data is a flat (de-normalized) data structure, and the target definition is hierarchical in nature. In the following example, the source data is depicted in a structure that is de-normalized, such as a flat file.
The first set of mappings is for items that are the same for each record (keep in mind that there may be multiple records created at the target).
1. Map each of these source entries to its respective target:
Source | Target |
---|---|
ItemNumber | inventory.warehouse.instockitem.itemnumber |
Quantity | inventory.warehouse.instockitem.itemquantity |
WarehouseCode | inventory.warehouse.warehouseinfo.warehousecode |
WarehouseState | inventory.warehouse.warehouseinfo.warehousestate |
2. Once you've mapped these four elements, compare your work to the figure below:
The remaining source data elements (Color, Weight, and Cost) will each require their own “copy” of the target folder.
You will now have three additional copies of the instockitem folder, indicated by the #1, #2, and #3 at the end of their folder names:
Now you need to map your source data elements to these new target folders.
Repeat these steps for the source Weight and Cost data elements, mapping them to the instockitem#2’s and instockitem#3’s respective attributevalues [V]. Compare your work to the figure below.
Each of the data elements you mapped to the multiple occurrences of the folders needs to have its corresponding attributecode data element defined correctly:
NOTE: Make sure you use all capitals, as the XML target could be case-sensitive.
You’ve completed your Transformation mapping. To test it, create an operation that references the appropriate source, target, and this transformation that you just made.