on 11-11-2014 5:51 PM
Hello,
I have a scenario where I map a response message from source to target.
And after the mapping in the target I have duplicate messages in a context.
Can you suggest, please, how it's possible to delete these duplicates? May be an adapter module? I use http_aae->PI->XI synch scenario
Thanks
Thank you for your attention, guys.
I think I didn't describe properly what I want to do.
Let say our response (in a synch scenario) from target system looks like this:
<SomeValues>
<Item>
<value1> 1 </value1>
<value2> text1 </value2>
</Item>
<Item>
<value1> 2 </value1>
<value2> text2 </value2>
</Item>
</SomeValues>
After mapping on PI side, the result looks like this:
<SomeValues>
<Item>
<value1> 1 </value1>
<value2> text1 </value2>
</Item>
<Item>
<value1> 1 </value1>
<value2> text1 </value2>
</Item>
</SomeValues>
And I want to send this to the sender as a response:
<SomeValues>
<Item>
<value1> 1 </value1>
<value2> text1 </value2>
</Item>
</SomeValues>
So, the question, how is it possible to implement?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Yes, indeed u can write AM to truncate duplicate nodes or even JM or XSLT can also do the same for u, but i think it's quite easier to do this in graphical mapping in comparison to others.
In case u don't want to touch ur main mapping then u can create one intermediate mapping which would just delete duplicate nodes and call it after ur main response mapping (in OM).
Thanks
Amit Srivastava
I guess u want to know about the intermediate mapping step? right?
So create one more graphical mapping and select response structure which sender is expecting as the sender and receiver message type and then in that mapping remove the duplicate nodes (u can refer the mapping which i have shown above) and for rest of the fields where duplicates are not expected u can do 1:1 mapping.
Eventually in the Operation mapping under response tab, add ur newly created graphical mapping as the second step just after ur main reponse mapping.
Thanks
Amit Srivastava
Hi Kyril,
I disagree with module development for your problem, because mainly is a mapping problem. The key is to play with removeContexts and collapseContexts but you should more clear with the mapping. Do you want to skip the vaules of value1 or value2 repeated? why the second item is not desired to be mapping, this means that you only want the first item?
I think, may be i'm wrong that you don't want the value1 repeated (may be the vvalue2 also?), if you removeContexts, sort, splitByValue(value changed) and later collapseContext you can remove the duplicates, if you want the value as well it will be more complicated. May be this wiki can help you: Difference Between RemoveContext and CollapseContext. - Process Integration - SCN Wiki
Regards.
Hi Kiryl,
use 'removeContext' function on "Items" node and then 'collapseContext' function. It would pass only one "Items".
Difference Between RemoveContext and CollapseContext. - Process Integration - SCN Wiki
Regards,
Nabendu.
Hi Kiryl,
I suppose the duplicate is not really the same message with the same ID, i think you have detected it because you have seen the payload with the same data. The problem can be in the sender system you will need to check with sender developers if they are sending the same data twice or several time.
Inside PI you haven't any standard function to avoid messages with different ID but the same data.
A synchronous scenario can't retain the messages then the only solution that i imagine is to store via JDBC/RFC lookup the data or the key data and to check in the mapping stage, when you detect ot you can throw an exception via UDF for example or to prepare an alternative receiver to receive this messages but you need to have in mind that the sender will require a response.
Hope this helps.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kriyl,
Why did you duplicate when you don't want that at the final Response back to Sender?
Regards,
Nabendu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.