cancel
Showing results for 
Search instead for 
Did you mean: 

Handling 0.* fields via Multi mapping in SAP CPI in extension iflow

dpan
Member
0 Kudos

Hi,

I have a requirement where i have to override the value mapping of few fields in the standard mapping provided in the OOTB iflow. I need to do this by creating an extension iflow rather than customizing the existing one.

I have created an extension iflow and added multiple messages in source where first message is the output from standard mapping and second message is the source payload.

Now, my requirement is that for value[2] and value[3] in the highlighted value tag, i want to change the mapping logic based on certain fields in source message 2 while for rest of the values, i want to go ahead with the output coming in the standard iflow (message 1 in source). Hence, i am writing a groovy script function to specify the custom mapping logic specifically for value[2] and value [3]. But i am not able to understand how i can identify if the value coming in will be a value[2] or a value[3]? Is there a way in CPI messages to identify the column name corresponding to this incoming value? Or is there a way in CPI to set a global variable above my custom function in the groovy script which i can use to count if the incoming value tag in a row is the second or the third one? Or any other better way to achieve this? Any help is much appreciated here.

Accepted Solutions (0)

Answers (1)

Answers (1)

Hi dpan,

Instead of having the logic based on receiver data. If you could identify the condition on the source side it would be easier to achieve the solution.

For eg:

/ns0:Message1/Root/Child1/field4 <> 'test'.

i.e. if you could tell what is the source condition based on which you want to create target then it would be easier to find the solution.

In case you are unable to get the correct login in one mapping suggest you to break the entire logic in two mappings.

In addition if you could provide the source and target xml as well.

thanks and regards,

Praveen T