Skip to Content
avatar image
Former Member

Dynamically multiple target nodes

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Feb 11, 2010 at 11:12 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 11, 2010 at 11:13 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 11, 2010 at 11:23 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 11, 2010 at 12:02 PM

    Thanks...suggested solution worked...

    Closing this thread....

    Add comment
    10|10000 characters needed characters exceeded