cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue in PI 7.1

Former Member
0 Kudos

Hi Experts,

We have an issue in graphical mapping wherein there is a node S in the Source which is 0...unbounded. This node S has an element S1 amongst a few other elements. The occurence of S1 is 0..1. Now we populate the target node T only if the element S1 contains a value "Active"(Have made use of IFS Then). This works fine in all cases, however since the occurence of S1 is optional, in case S1 does not occur for a particular case, the mapping leads to context issues(does not throw an error).

Kindly suggest if there is a way i can check if the node S1 is coming or not. Exists condition doesnt seem to be working.

Cheers,

Sriram

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Amit, All

Map with Default does not work here. Whenever the field Name is missing in one of the context then rest of the values in the queue gets jumbled up.  What happens in my case is as below:

There is a certain case when the field Name as per your mapping above does not come at all(Its not that its an empty tag.the field itself does not come in the XML) Due to this missing field, my mapping doesnt take into acccount that there is a context in whcih Name has gone missing and finds this field in the next context and messes up all the further context values.

Please advise what can be done here. If the source system sends in the Name field(even with an empty tag), this will work, however as per source schema this is an optional field and hence they are reluctant to send it.

Appreciate everyone's help here.

Cheers,

Sriram

Former Member
0 Kudos

 

Hi Sriram,

if the element S1 does not exist or empty or not equal to 'ACTIVE', the node 'record' will be supressed

Try this

Regards,

sagarika

Former Member
0 Kudos

Hi Sagarika,

Maybe could you help me. My problem is that after the field RECORD, I have others fields at the same level so only the field name for the same row of record should be shown. Next record, should have the second name, third record should have the third name.

r_s_kulkarni11
Participant
0 Kudos

Hello Sriram,

I am agree with Amit's suggestions.

additionally you can try createIf function before mapping the result to target node.

Former Member
0 Kudos

Hi Rahul,

Thanks for your reply. CreateIf will just help with populating the node based on a condition. It will not be able to map a particular source node to target based on a condition.

Please advise.

Regards,

Sriram

Former Member
0 Kudos

Hi All,

Below is the mapping at our end. It works fine till S1 occurs. In case of missing S1 the mapping goes haywire.

Former Member
0 Kudos

use mapwithdefault  just after S1. Rest should remain as it is. No change in the context of S1. Mapwithdefault will fill all missing values of S1.

regards,

rahul

Former Member
0 Kudos

Hi Sriram,

     As already suggested by many others, use a "MapWithDefault" function just after your source segment (S1). It will work.

Regards,

Lakshmi Naik

Former Member
0 Kudos

Hello,

Paste ur mapping here.

BTW, u can try to use "mapwithdefault" just after S1 element and then use Remove context followed by ur actual mapping conditions (ifs).

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Amit,

This does not work. The mapping condition is   ifS S1 equalsS Active then map S to T. Let me know if u need a screen grab.

Regards,

Sriram

Former Member
0 Kudos

Hello,

Let me put this way, u want to generate target node "T" as many times as S1 element exist in source? If yes, then chk below mapping:

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Amit, All

Map with Default does not work here. Whenever the field Name is missing in one of the context then rest of the values in the queue gets jumbled up.  What happens in my case is as below:

There is a certain case when the field Name as per your mapping above does not come at all(Its not that its an empty tag.the field itself does not come in the XML) Due to this missing field, my mapping doesnt take into acccount that there is a context in whcih Name has gone missing and finds this field in the next context and messes up all the further context values.

Please advise what can be done here. If the source system sends in the Name field(even with an empty tag), this will work, however as per source schema this is an optional field and hence they are reluctant to send it.

Appreciate everyone's help here.

Cheers,

Sriram