Search This Blog

Monday, November 28, 2011

New functions in the Graphical Mapping Tool XI 3.0 SP13


The graphical mapping provides some useful functions with starting with XI 3.0 SP13:
- The node functions mapWithDefaultformatByExamplesort and sortByKey
- The statistic function index

The function mapWithDefault

This function provides a default value, whenever the source element is not available. This is useful function, when you want to use the content conversion of the file adapter. Look at this example:
image
Before SP13 we had to use a combination of the functions exists and if, now we need only one function:
 image

The function formatByExample

This function allows grouping of values of a tag according to values of another tag. Look at this example:
 image
We can achieve this with our new function:
 image
The other nodes are mapped with help of the node functions splitByValue and collapseContexts like follows:
 image
Make sure, that the context of the node ID is set to ORDERLIST in all cases.

The functions sort and sortByKey

Of course these functions are used to sort elements. Let us look at this example:
image
The elements in tag PRODUCT shall be sorted the same way as the elements in tag ID. As the functions sort and sortByKey only sort the elements within the same context, we have to use the function removeContexts before sort. After sort we have to restore the original contexts. We do this with the node function splitByValue The mapping now looks like follows:
image

The function index

This function works like the function counter. The difference is that the function index repeats counting for each context. Let us look at an example:
image
We want the tag No to count the positions in an order. For this reason we have to provide the correct contexts. This can be done by the node functionsplitByValue. After creating of the correct index numbers, the values have to be separated to different contexts. This can be achieved as well with the node function splitByValue.
image
I hope this blog will help you to understand the use of the new mapping functions.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.