Show TOC

Defining Data MappingsLocate this document in the navigation structure

Use

Data mapping defines rules for transforming the source context to the target context. For more information about the data mapping rules, see Data Mapping Rules .

Mapping Assignment Options

Depending on the nodes type and their cardinality, you can define the following mapping assignment options:

  • Set

    Set is the default assignment for both node types. When you use the set option, the source context overrides the target context.

    Example

    In the source context object, you have one element and the target object is a list containing five elements. When you use the set option, after the mapping you have one element.

  • Append

    The append option is available for both node types if the maximum occurrence is greater than 1. When you use the append option, the source context objects are appended to the list of existing target context objects.

    Example

    In the source context object, you have one element and the target context object is a list containing five elements. When you use the append option, after the mapping you have six elements.

  • Merge

    The merge option is intended for structured target data. When you use the merge option, the source context objects are merged with the target context objects. New objects are created in the target object if the number of objects in the source object is greater than the number of objects in the target object.

    Example

    In the source context object, you have a list containing five nodes A, B, C, D, and E. In the target object you have a list containing two nodes M and N. When you use the merge option, after the mapping you have a list with the following nodes: M, N, C, D, and E.

Procedure

Defining Mapping and Expression Functions

You define data mappings in the mapping and expression editor where you use the source and target data nodes for the transformation you want to accomplish. You can use expressions over the context nodes and different types of functions for performing the complex data transformations. When you define a mapping, you can map a node from the source context to more than one node from the target data structure. In addition, you can map more than one source context node to a node from the target data structure. From the context menu of the mapping lines in the mapping editor you can set the mapping assignment options. If you want to undo a mapping you have created, you have to select the mapping line in the mapping editor and delete it.

For more information about how to create and use of functions and expressions, see:

Caution

An error marker on the function icon of the mapping line means that the mapping has an error and cannot be done. Errors in mappings are only visible in the mapping editor but are not visible on the modeling surface or in the Problems view.

Caution

If you map a node, whose content is a list or a node with one or more parents that are lists to a single-valued node, you get an error. Depending on your needs you could provide a custom expression, for example to aggregate the list to a single value, or you could perform parent mapping between the multi-valued parent nodes.

Using Custom EJB Functions

You can create external functions with custom Java code and use them within a mapping.

For more information, see Creating an External Function, Exposing It as an EJB, and Using It as a Mapping Function .

Using the Automapping Option

When you define data mappings, you may use the automapping option and spend less time and effort to define the mappings. The automapping option creates a set of mapping suggestions using different algorithms.

For more information, see Defining Mappings Using the Automapping Option .

Applying Quick Fixes in Data Mappings and Expressions

You also have the option of fixing some common errors, which may occur when you define data mappings by applying a quick fix.

For more information, see Applying Quick Fixes in Data Mappings and Expressions .