How to use the SmartMapper in BusinessWorks 6.X and BusinessWorks Container Edition
While this is very common in integration projects to do mappings between structures that are different but manage variants of the same business object, like for example mapping an order from a customer portal to a SAP back-end, a Smart Mapper tool has been introduced in recent releases of BusinessWorks and BusinessWorks Container Edition.
This tool is using pattern-matching technologies, some will say Artificial Intelligence, to match fields from the input and output structures and automatically map them when possible.
It should not be confused with the Plug In for Smart Mapper that is a tool to manage Cross-references between applications (for example currency code cross-references).
This article is an introduction to the Smart Mapper tool.
Enabling the Smart Mapper
Before using the Smart Mapper you need to enable it, this is done with the following:
. From Studio Select the Windows -> Preferences -> Mapper menu
. Check the Enable Smart Mapper option
. Then Click Apply and Close
Using the Smart Mapper
Now the Smart Mapper can be used to map a structure to another structure containing the same object or a very similar object.
In the example below we want to map a source ‘Employee’ structure to a target ‘Employee’ structure, the two structures are very similar but not identical so the usual ‘Copy-Of’ and ‘auto-map’ features cannot be used.
Meanwhile the ‘Employee’ object is the same and only the following elements are different:
. Most field names are different
. The emergency contact details are in a sub-structure in the Source structure and at root level in the target structure
The two structures can be mapped automatically with the Smart Mapper:
1. Map the ‘$Read-Employee’ structure to the ‘Employee’ structure
2. Select the ‘SmartMap’ option in the displayed dialog box
3. Click ‘Finish’ in the displayed dialog box to use the default matching configuration:
In that dialog box you can also select the ‘Custom’ option to tweak the pattern recognition algorithm or the ‘Match Exact Names’ option to automatically map only fields with names that are strictly identical.
4. Check the results
The Smart Mapper has automatically created the following mappings:
In our example, all mappings are correct but you have to keep in mind that it might not always be the case so it is recommended to review the created mappings and check for possible errors.