Skip to Content
avatar image
Former Member

Replicate Target node

Hi All,

How to replicate a target node with respect to one occurence of source element and how to map different values in its child elements?

For eg in my case currency line item should be replicated twice for one occurence of amount field and its child elements (ie for currency line item )should hold different values in each of its occurence ?

can we achieve this with out udf if udf is required how to proceed with it ?

Full Points will be awarded

Regards

Satish

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Oct 13, 2008 at 10:19 AM

    Hi Satish,

    You can write one udf with follwoing code and the input will be the amount field also change the context of your amount field to 1 level up. Use this UDF and map to LineItem segment

    for(int i=0;i<amount.length*2;i++)

    result.addValue("");

    These many child nodes will be generated for Lineitem therefore

    for the child nodes also you can do like this but dont forget to use splitByValue node function for child nodes and map them with corresponding source fields.

    Thanks!

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi All

      I achiecved this by simply Duplicating the Particular Node and mapped a constant Value to the duplicated node and the requred input for child nodes

      Thanks and Regards

      Satish

  • avatar image
    Former Member
    Oct 13, 2008 at 09:50 AM

    Hey,

    as far as my understanding,

    you can use node funciton exists and createif for header node and a one to one mapping for child node.

    amount-> exists-> createif-> currency line item.

    amount-> child node.

    this will be the case if amount is repeating.

    if the amount node is not repeating, you can map the child node of amout, which must be repeating.

    regards,

    Milan

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 13, 2008 at 09:55 AM

    Use node functions SplitByValue (Each Value) and RemoveContext for multiple occurrence of node.

    Same functions could be used at child level also.

    Regards,

    Prateek

    Add comment
    10|10000 characters needed characters exceeded