on 2020 Apr 16 7:51 AM
Dear Experts,
I need to replicate the root node based on the value in one of the fields, please suggest if there is any option to achieve it using graphical mapping.
Input XML:
<example_MT><Records>
</Records></example_MT>
If value of count is more than 1, as it is in above example, it should create target nodes with the count value as below:
<example_MT><Records>
</Records>
<Records>
</Records>
<Records>
</Records></example_MT>
Thanks,
Sudhir
Finally I was able to get the required result. Initially I was trying to do everything at the record level, which could be confusing with changing context at every level. Now I'm using the same UDF at both Record and field level.
UDF:
Execution Type: All values of queue
Two arguments: Var1: String, Var2: Integer
for(int i=0;i<var1.length;i++)
{ for(int j=0;j<var2[i];j++)
{ result.addValue(var1[i]);
}
}
Record level Mapping:
Pass "Records" as first argument and "Count(data type: Integer)" as second argument, will create the correct output structure.
Field level Mapping:
Pass "field1" as first argument and "Count" as second argument, then pass the output of this UDF with Node function "SplitByValue(each value)" It'll populate the correct value in the output structure.
Same has to be done for all other fields.
Regards,
Sudhir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
11 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.