cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Problem

Former Member
0 Kudos

Hi,

I have a scenario in which my source message is like:-

<Zone>

<header>

<1>abc</1>

<2>def</2>

<3>ghi</3>

</header>

<Customer>

<a>

<b>

<c>

<d>

<e>

<f>

</Customer>

<Customer>

<a>

<b>

<c>

<d>

<e>

<f>

</Customer>

</Zone>

<Zone>

<header>

<1>rst</1>

<2>qwe</2>

<3>tyu</3>

</header>

<Customer>

<a>

<b>

<c>

<d>

<e>

<f>

</Customer>

<Customer>

<a>

<b>

<c>

<d>

<e>

<f>

</Customer>

</Zone>

There will be only one header for a zone but many customers in a zone

and my target message is like

<Customer>

<1>abc</1>

<2>def</2>

<3>ghi</3>

<a>

<b>

<c>

<d>

<e>

<f>

</Customer>

<Customer>

<1>abc</1>

<2>def</2>

<3>ghi</3>

<a>

<b>

<c>

<d>

<e>

<f>

</Customer>

<Customer>

<1>rst</1>

<2>qwe</2>

<3>tyu</3>

<a>

<b>

<c>

<d>

<e>

<f>

</Customer>

<Customer>

<1>rst</1>

<2>qwe</2>

<3>tyu</3>

<a>

<b>

<c>

<d>

<e>

<f>

</Customer>

The mapping is--the header values will be common for the customers in that zone and the target message should contain the header values and the customer details.In other words the target message should be header+customer details of all the zones.

I am not finding a way to map like this.

Accepted Solutions (1)

Accepted Solutions (1)

gagandeep_batra
Active Contributor
0 Kudos

Hi Ankit

use "useoneasmany" function for that

Regards

Gagan

Former Member
0 Kudos

I already tried oneasmany function but what happens is that header values are not picked up for the next zone.

There are many customers in a zone with one header.Like wise there will be many zones so a different header will be there for each zone.My target is to create a list which will contain header+customer deatails of all the zones.So, Different header values will be inserted whenever a new <zone> tag is encountered.i,e Customer will have different header values corresponding to diffrent zones.

Regards,

Ankit Baid

ambrish_mishra
Active Contributor
0 Kudos

Hi Ankit,

Here is what you need to do:

test case:

Hope it is clear!

Ambrish

Added screenshots

ambrish_mishra
Active Contributor
0 Kudos

here is the sample mapping

Former Member
0 Kudos

Hi Ambrish,

I did the above mapping.Its woking for only one zone.When i tested in message mapping by duplicating the zone tree with different header values its creating for the first <zone> tag only and no nodes are created for consumers in another zone with different header.

Please suggest.

Thanks and Regards,

Ankit Baid

Former Member
0 Kudos

Hello,

Change the context of "Consumers" node and set it to MT*** name (right click -> change context) and then map the same to "access" target node.

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Amit,

Its working now.

Thanks,

Ankit Baid

praveen_sutra
Active Contributor
0 Kudos

hi Ankit,

Map

[Cunsumer]----> [SplitByValue]--->[access]

this will bring [Access] occurrence to sync.

then check and let us know what is the next issue.

thanks and regards,

Praveen T

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ankit,

  I have tried to create a dummy structure and map going through your query also your above mentioned comment . Can you please check if this works for you.

   Map:

Output:

Former Member
0 Kudos

Hi Arpan,

The Output you are getting is absolutly correct. Can you please send the screenshots of all the mappings you did because by changing the mapping for H1 i am not able to get the desired output.

Thanks in advance

Regards,

Ankit Baid

Former Member
0 Kudos

Hi ankit,

please use global variable instead of useoneasmany please try once.

thanks,