cancel
Showing results for 
Search instead for 
Did you mean: 

Handeling mapping with multiple nodes

Former Member
0 Kudos

Hi,

We are doing an IDOC to SOAP scenario, in which we have multiple nodes in source structure. In destination structure we have one node having multiple occurences (1..99). We are trying to do the mapping in such a way that on the basis of no. of nodes at source side, nodes at destination side should be created.

Any idea how to perform this mapping? Is it necessary to use BPM for this?

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member206760
Active Contributor
0 Kudos

1. Node 1 -> count ->

2. Node 2 -> count ->

3. Use ADD(std function) 1 and 2

4. then after step 3 use UDF given below and then mapp to target node

create advance UDF function and click on radio button "Queue".

in the imports section enter java.lang.;java.util.;java.lang.reflect.;java.io.;

//write your code here

String e = a[0];

int b = Integer.parseInt(e);

for(int i=0;i<b;i++)

{

result.addValue("1");

}

result.addContextChange();

This is working for me...

suppose node1 occurs 3 times and node2 occurs 2 times the target node will occur 3 + 2 = 5 times

Giving points is another way to say thanks

Edited by: Tarang Shah on Mar 4, 2009 2:06 PM

former_member206760
Active Contributor
0 Kudos

Using count function get the total count of nodes and then using a UDF create as many dummy valaues within one context as you get in the count ..for e.g. if you get total count as 6 for all of the source nodes ..in the udf create 6 diff dummy values in a single context and assign to target node

Giving points is another way to day thanks

Shabarish_Nair
Active Contributor
0 Kudos

tarang,

would like to know wht is it different you have posted from the earlier posts here

prateek
Active Contributor
0 Kudos

former_member206760
Active Contributor
0 Kudos

Sabarish,,,

Just a coincidence :)....did not chk out your reply......:)

Shabarish_Nair
Active Contributor
0 Kudos

no issues .. u made up by giving a good explanation after that which helped the user.

SudhirT
Active Contributor
0 Kudos

Simply do one to one mapping for the multiple occurence node with the source repeating node as suggested above.

prateek
Active Contributor
0 Kudos

We are trying to do the mapping in such a way that on the basis of no. of nodes at source side, nodes at destination side should be created.

Simply may the multiple times occurring node at source to multiple times occurring node in target. And it will automatically give you the desired result. If the target side node is the root node then you need to use multimapping.

BPM is not required.

Regards,

Prateek

Shabarish_Nair
Active Contributor
0 Kudos

>

> Hi,

> We are doing an IDOC to SOAP scenario, in which we have multiple nodes in source structure. In destination structure we have one node having multiple occurences (1..99). We are trying to do the mapping in such a way that on the basis of no. of nodes at source side, nodes at destination side should be created.

> Any idea how to perform this mapping? Is it necessary to use BPM for this?

Use the count function. Get the total count of nodes and then in a UDF pass a resultset with that number of counts.