AnsweredAssumed Answered

Merge two different XML Profile using cache

Question asked by phani.kumar@enjoy.com on Oct 27, 2017
Latest reply on Oct 27, 2017 by phani.kumar@enjoy.com

Experts,

How to combine (using cache) two XML profiles and produce a new XML Profile.

 

 Input Profile1 (Customers):

<customers>
<customer>
   <ssn>ssn1</ssn>
   <name>name1</name>
</customer>
<customer>
   <ssn>ssn2</ssn>
   <name>name2</name>
</customer>
</customers>

 

Input Profile2 (Accounts):

<accounts>
<account>
   <acctno>acctno1</acctno>
   <ssn>ssn1</ssn>
</account>
<account>
   <acctno>acctno2</acctno>
   <ssn>ssn2</ssn>
</account>
</accounts>

 

Output Profile3 :

<custaccts>
<custacct>
   <ssn>ssn1</ssn>
   <name>name1</name>
   <acctno>acctno1</acctno>
</custacct>
<custacct>
   <ssn>ssn2</ssn>
   <name>name2</name>
   <acctno>acctno2</acctno>
</custacct>
</custaccts>

 

Approach I am following:

1- Split profile1 at SSN element and load it in to CACHE with cache-key as "SSN".

That means, technically Cache holds two profile1 documents.

2- create a Map with source as Profile2 and attach CACHE with SSN  and map the target to Profile3.

 

Flow:

cache setup:

split:

 

Profile2 Mapping (which combines above cached two documents of profile1 with profile2)

Observation:

 

Expected output:

==============

<custaccts>
<custacct>
   <ssn>ssn1</ssn>
   <name>name1</name>
   <acctno>acctno1</acctno>
</custacct>
<custacct>
   <ssn>ssn2</ssn>
   <name>name2</name>
   <acctno>acctno2</acctno>
</custacct> 
</custaccts>

 

But, actual output (which is wrong):

 

What I am doing wrong here ?  

Outcomes