on 07-04-2016 10:09 PM
Hi All,
I am having trouble with a graphical mapping where I am using the node function useOneAsMany. From a source XML I am generating multiple IDOCS, here is a crude example of the source XML message:
<GetSite>
<Member>
<emailAddress>site1@gmail.com</emailAddress>
<deliveryAddresses/>
</Member>
<Member>
<emailAddress>site2@gmail.com</emailAddress>
<deliveryAddresses>
<MemberAddress>
<accountAddressCode>1111</accountAddressCode>
</MemberAddress>
<MemberAddress>
<accountAddressCode>2222</accountAddressCode>
</MemberAddress>
</deliveryAddresses>
</Member>
</GetSite>
The graphical mapping generates one IDOC for each <MemberAddress> node in the source XML. In the above case it generates two IDOCS:
<IDOC>
<Site>
<accountAddressCode>1111</accountAddressCode>
<Email>site2@gmail.com</Email>
</Site>
</IDOC>
<IDOC>
<Site>
<accountAddressCode>2222</accountAddressCode>
<Email>site2@gmail.com</Email>
</Site>
</IDOC>
The <Email> field in the IDOC must come from the header node of the source XML <Member>. I have achieved this with the useOneAsMany node function. It works fine when <Member> contains sub-node <MemberAddress> as an Idoc is always generated. However when the source XML file contains <Member> with no sub-node <MemberAddress> it is causing a problem. See the example below:
As the useOneAsMany function takes <emailAddress> as the first input it is getting confused as the first occurrence of <emailAddress> in the above XML does not generate an IDOC (which is correct).
Does anyone have any advice on how to get around this issue?
Che
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harish,
You are a star! Initial results look good, just need to do some more testing.
It is very tedious that each field mapping has to use the Member context, mapWithDefault and SplitByValue, I have a lot of other fields to map.
It maybe be a lot easier if I could remove those <Member> nodes that have no child node <MemberAddress>, perhaps using an XSLT. I have found in those cases the mapping works without any need for complex context mapping.
Che
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.