Like Mapping

Like mapping is useful in automatically mapping complex elements that are of different types but contain equivalent content.

For instance, a BPM application may have two different types VisitorDetails and PatientDetails that share some commonly named children. Performing a like mapping between these two objects is the equivalent of manually mapping all the same named simple type content from the source list to the target list.

It is possible to perform like mapping between arrays of complex types. In this case the equivalently-named child content mappings implied by the like mapping are applied to each element in the array according the the chosen array mapping strategy. If there are nested child arrays that would be like-mapped then the array mapping strategy is selected separately for each.

A like mapping scans the target element tree looking for the same named content in the source tree. Initially, all equivalently-named child objects get mapped regardless of their type. If the objects are of different types, the mapping shows an error decoration. You can fix the problem in the BOM definition by excluding certain target child elements from the mapping (as described in the step to exclude child elements). The overall strategy for handling mappings into the children of complex type target data is to create the target element if it does not exist prior to performing assignment to the child element. If the target parent element already exists then the assignment is made to the child of the existing element. For mappings from children of source items, the assignment is only performed if the parent itself has a value. If the parent element is not assigned, then the target element remains unchanged.
Note: Like mapping is case-insensitive for the names of child objects.
Like mappings are fully recursive, mapping similarly named composite objects that are within a particular target being mapped. However, only the child objects that are at the same level are included in the like mapping.

If there are nested child arrays that would be like-mapped then the array mapping strategy is selected separately for each array.