Salesforce

XML Position Forwarding (Magic xpi 4.9)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

XML Position Forwarding (Magic xpi 4.9)

The XML Position Forwarding functionality can be used only with XML Sources and Call Flow Destinations. It allows you to pass the compound (complex element) to the called flow for additional processing for each iteration of that compound. The mapped compound element will be considered as root in called flow when the XML Position Forwarding functionality is used.

The idea is to enable the access of all the compound children element for the current iteration of the parent compound. Note that the direct non-compound children of currently passed parent should not be accessed in the called flow. Only compound children of the mapped parent should be accessed in the called flow. In case you want direct children accessible in the called flow, then pass them as the variables of the called flow schema.

To sum it up, for the parent compound that is being passed to the called flow, its compound children will also be available for each iteration of the parent compound.

If you map the direct non-compound children of parent, it will give unintended result because each time all the occurrences of the parent context will be processed inside the called flow.

In the following example, an xml source contains Regions as root element and has multi occurrence Region elements in it. Each Region has multi occurrence Company elements inside it. You want to process for each Region to access all Company compound elements of that Region in another flow.

For this, first you need to map Regions/Region to CallFow Flow-2. So that for each Region, Flow-2 will be invoked. In Flow-2 you can take Company compound for current Region. In case you need Name element of Region to be accessible in Flow2, then you need to pass Name element to a variable of called flow (say C.UserString). Note the difference, here the Name element is mapped to the variable of Call Flow schema but for Company compound you do not need any mapping from XML source to Flow-2. It automatically become available in Flow-2 for current Region.

As shown above, Region/Name should not be accessed in Flow-2. Instead C.UserString should be used as it contains Region/Name from Caller Flow.

This is the change in behavior Since version: 4.9

To use the XML Position Forwarding functionality:

  1. When you define the Source's XML properties in the called flow, select XML Position Forwarding from the XSD Sub Type property's drop-down list. Then, click next to the XML Position Forwarding property.

  2. The Schema List opens, which displays a list of all the Data Mapper steps that call the current Data Mapper. Select one of these steps as the calling Data Mapper.

When you have selected the required calling Data Mapper, the following fields are updated in the XML Source Properties dialog box, according to the calling Data Mapper properties:

  • XSD File: Read-only. This displays the calling flow XSD path.

  • Data Source: Read-only. This displays the calling Data Mapper's data source.

  • XML Root: Read-only. This displays the XML's full file path up to the compound element that is mapped to the called flow.

  • Recursion Depth: Read-only. This displays the recursion depth setting from the calling step.

The original Source's mapping in the called flow can handle all mapped compound members and their compound elements, as with any other mapping.

  • If there is only one flow available, the flow selection form will not be displayed, and a form containing all mapper steps that call the current Data Mapper will be displayed. The user can only select one Data Mapper.

  • If there are multiple flows available, the flow selection form will be displayed and upon user selection, the Data Mapper selection form will be displayed.

  • The mapping of the original Source in the called flow can handle all mapped compound members and their compound elements, as in any other mapping.

  • In the called flow, the mapping of the root element, and all compound elements above the root element, are based on the calling flow. Changing these mappings can lead to unintended results.

  • XML position forwarding defined with an inactive source flow might cause unexpected behavior during runtime.

Reference
Attachment 
Attachment