1/20/2015: Updated with an example multi-map Payload
Multi-mapping dynamic configuration has been a frequent requirement and there are many open questions in SAP PI space, since multi-mapping doesn't support dynamic configuration i.e., a separate dynamic configuration for each child message. Some time back I wrote a blog Multi-mapping: Assigning ASMA's for Child Messages using Custom Adapter Module and FM but unfortunately that solution can't be used for PI/PO single java stack systems
In this blog, I would like to share my new solution using a simple generic custom adapter module. The module can be used for any J2EE technical adapter by just configuring it in the respective communication channel. The module is applicable for all pi versions except few changes to import statements and few methods due to changes in module API. Highlighted the required changes as a comment in the attached module source code
Steps
Transformed Example Multi-Map Payload from Mapping:-
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:MT_Receiver xmlns:ns1="http://pg.com/multimap">
<!-- ENHANCED DCHeader STRUCTURE for Dynamic Configuration -->
<DCHeader>
<DCRecord>
<DCValue DCNameSpace="http://sap.com/xi/XI/System/File" DCTechnicalName="FileName">Data1.xml</DCValue>
</DCRecord>
<DCRecord>
<DCValue DCNameSpace="http://sap.com/xi/XI/System/File" DCTechnicalName="Directory">./PI_OUT/Files/</DCValue>
</DCRecord>
</DCHeader>
<!-- ACTUAL TARGET STRUCTURE -->
<Name>Praveen1</Name>
<EmpID>1234</EmpID>
<Project>ABC</Project>
</ns1:MT_Receiver>
<ns1:MT_Receiver xmlns:ns1="http://pg.com/multimap">
<!-- ENHANCED DCHeader STRUCTURE for Dynamic Configuration -->
<DCHeader>
<DCRecord>
<DCValue DCNameSpace="http://sap.com/xi/XI/System/File" DCTechnicalName="FileName">Data2.xml</DCValue>
</DCRecord>
<DCRecord>
<DCValue DCNameSpace="http://sap.com/xi/XI/System/File" DCTechnicalName="Directory">./PI_OUT/Files/</DCValue>
</DCRecord>
</DCHeader>
<!-- ACTUAL TARGET STRUCTURE -->
<Name>Praveen2</Name>
<EmpID>4567</EmpID>
<Project>XYZ</Project>
</ns1:MT_Receiver>
</ns0:Message1>
</ns0:Messages>
That's all. Hope this new solution is simple, efficient and can be useful for your projects. Please share your feedback to improve the code. Thanks..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |