cancel
Showing results for 
Search instead for 
Did you mean: 

Graphical Message Mapping - please help

Former Member
0 Kudos

Hi All!

I do have a requirement to map 1 XML file containing large amount of records into a SOAP service operation call that is bulk. The target Message will be more complicated in its hierarchy than the source message.

I'm new to PI Message Mapping. I went through some tutorials and blog posts in SCN focused on contexts and queues. I understand the context concept (i.e. what it is), but queues and functions are still mistery to me (perhaps I'm so used to ABAP debugger which allows to analyse anything, and these contexts and queues are just "undebuggerable"..). So I still cannot go through my message mapping case to make it work.


Currently I'm prototyping this, so the messages shown below do not reflect 1:1 my real messages.


Here it is:

Assumptions:

- each source/Record element should create target/CardContract/BussContent element

- source/Record/newCardID should be mapped to target/CardContract/BussContent/CardID field


So far I managed to have a target message produced but only using constant value for target/CardContract/BussContent/CardID as when I simple connect newCardID and CardID - it doesn't work for more than 1 occurence of the source/Record element in the test source message.


Test data that don't work (mapping error - no value for BussContent[2]/CardID ) when I connect newCardID to CardID:


After I'll have this done - I need to take care about splitting the target message to multiple messages every x occurences of the source/Record element. But that's future and step 2 after I'm done with the current problem (I know there are blogs about splitting and multimapping).

Any hints or solutions how the GUI mapping should look like? Any context changes necessary, any functions to be used?

Thanks in advance for your help.

Regards

Greg

Accepted Solutions (1)

Accepted Solutions (1)

former_member190293
Active Contributor
0 Kudos

Hi Greg!

Mapping:

Result:

Regards, Evgeniy.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi all,

Thank you very much for the support - that's very much appreciated!!. I'm really surprised (positively) how much support one may expect from this PI community. Thanks again!

I'm also surprised how two solutions (Evgeniy's and Rahul's) may give the same, correct result at the end being different in terms of complexity..I still need to understand theses concepts better as otherwise I will never know.

Now let's take the issue on the next level as mentioned at the beginning. The final requirement is to have message splits. Let's say every 3 occurences of the source/Record element the message should be split and so there should be another instance of the target message created.

I mean the following:

Record1 -> MT_CardCrdAsBulk1->BussConent1

Record2 -> MT_CardCrdAsBulk1->BussConent2

Record3 -> MT_CardCrdAsBulk1->BussConent3


Record4 -> MT_CardCrdAsBulk2->BussConent1

Record5 -> MT_CardCrdAsBulk2->BussConent2

Record6 -> MT_CardCrdAsBulk2->BussConent3


and so on...


As far as I'm aware - this should be possible using a UDF function + changing the signature of the target message to 1..unbounded.


Could you guys suggest how the UDF should look like? For this particular message combination - is only one UDF required or more to split messages accordingly?


Thanks again in advance!

Greg

former_member190293
Active Contributor
0 Kudos

Hi Greg!

Please open new thread for your next requirement. It's the better way to get quick answers because forum members don't pay much attention to the threads marked as "Answered".

Regards, Evgeniy.

P.S. By the way, actualy, you don't need any UDF for splitting your source message into set of target messages upon rows count .

Former Member
0 Kudos

Hi Evgeniy

Thanks for the info. After some research indeed it seems no UDF is necessary and the same could be achieved by using just standard functions, but I'm still in trouble to make it work.

Thanks for your hint I posted another thread in the forum:

Thanks again

Best regards

Greg

former_member183249
Active Participant
0 Kudos

Hello Greg,

you need to do following mapping.

     Record ----> removeContext (Node Function) -----> CardContract   (Target Parent Node should                     have same context)

     Record ----> Header

     Record ----> BussContent


This will work fine.


Regards,

Rahul


Former Member
0 Kudos

Hi Rahul,

Thanks for the suggestion.

I've changed the flow to the one suggeted by you (just in case - please have a look at the below image to check if I did what you suggested me to do).

However - I'm still getting the error.

Thanks!

Greg

former_member183249
Active Participant
0 Kudos

Hi Greg,

You don't need to map the root node if its occurrence is 1:1. There is no need to map Nodes like Header, BussContent as they are parent node and have occurrence 1:1.

Kindly do the below mapping.

Below is the output of your test case:

     I hope this will solve your issue.

Regards,

Rahul

former_member186851
Active Contributor
0 Kudos

Hello Greg,

You wish to pass new or old CARDID to CARDID in the target?

Try

map records->BusinessContent.

CardID->SplitByvalue(EachValue)-->CardID.

Former Member
0 Kudos

Hello Raghu,

Not sure if I've mapped this according to your suggestion, but it didn't work.

Could you please take a look at the graphical mapping I've done?

Is this what you suggested?

The same error I'm getting:

Thanks!

former_member186851
Active Contributor
0 Kudos

S Greg,

Please post ur input queue values as well.

Try the logic mentioned by Rahul,If its not working I will assist more on this.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Greg,

Your error looks like you are passing three Records but the last one does not contain a newCardID hence the mapping error. Try adding mapWithDefault after splitByValue each value.

Regards,

Mark