cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically multiple target nodes

Former Member
0 Kudos

Hi,

In message mapping, I have a set of values in an array in the UDF, On which after looping at I want to create multiple target node in the target xml. The target node should duplicate to numbers of times equals to number of values in Source Array.

Can I achieve this by returning one by one value inside loop on array? .. Will this logic create multiple target nodes..?

Thanks

Amol

Edited by: AMOL BHARTI on Feb 11, 2010 12:09 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member181962
Active Contributor
0 Kudos

Hi Amol,

YOu can directly assign the list of values to the target value if all the values are in the same context.

If they are in different contexts, then use removeContext function and assign to the target node.

Source ->target node

or

Source->removeContext->target node

Regards,

ravi Kanth talagana

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks...suggested solution worked...

Closing this thread....

Former Member
0 Kudos

Hi AMOL,

If values are coming directly from the source fields then do as said by Ravi.But if not and you are writing UDF then target node can be duplicated as


for (int i=0;i<input.length;i++)
{
result.addValue(i);
}

(choose Execution type as ALL VALUES OF A CONTEXT).Also ensure that target node occurrence is 0..unbounded.

former_member187339
Active Contributor
0 Kudos

Hi Amol,

>>Can I achieve this by returning one by one value inside loop on array? .. Will this logic create multiple target nodes..?

Yes provided the target field has occurrence 'n' where n >= number of time you want it ot be created

Also if there is a parent node to this target field then it also need to be handled

Regards

Suraj