cancel
Showing results for 
Search instead for 
Did you mean: 

Replicate Target node

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

SudhirT
Active Contributor
0 Kudos

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!

Former Member
0 Kudos

Hi sudhir

thank u for your valuable suggestion.

I have created a UDF and given splitbyvalue to it .in the display queue for the target node is getting replicating but not while testing it.

and also for the child nodes i am able to replicate them but how to edit the value in it. eg the item no and posting key fields are there they hold different values as they replicate .

Please do the needful

Full Points will be Awarded

Thanks

Regards

Satish

Former Member
0 Kudos

Hey,

Use removecontext instead of SplitbyValue.

regards,

Milan

SudhirT
Active Contributor
0 Kudos

Hi Satish,

For item_no and Posting Key fields, pass them as input to the UDF like for Item_no

you can take as

for(int i=0;i<Item_no.length;i++)

result.addValue(""+Item_no square bracket i );

thanks!

Former Member
0 Kudos

Hi Sudhir,

I am new to XI , i have recently started working on XI.

I have done file to file scenario and file o RFC scenario to understand abt XI.

I dont know XML ,please guide us regarding how to go with node funtionality.

How to use them.

Regards,

Mayank

Former Member
0 Kudos

Hi Mayank

What exactly is your requirement. You can open a thread for it.

Thanks

Gaurav

Former Member
0 Kudos

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

prateek
Active Contributor
0 Kudos

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

Same functions could be used at child level also.

Regards,

Prateek

Former Member
0 Kudos

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