on 05-09-2011 12:02 PM
hello everybody
i'm crating a new message mapping (graphical).
I have a very easy Data Type structure, and i need split the result when the input field F1 have a value 001 (creating a new context).
I think is very easy but i cannot find the correct solution
this is the input:
<RECORDS>
<R10>
<F1>001</F1>
<F2>DT:13.03.11/23:08:45</F2>
</R10>
<R10>
<F1>002</F1>
<F2>NR:111879</F2>
</R10>
<R10>
<F1>003</F1>
<F2>NR:1</F2>
</R10>
<R10>
<F1>004</F1>
<F2>NR:1</F2>
</R10>
<R10>
<F1>001</F1>
<F2>DT:13.03.11/23:08:46</F2>
</R10>
<R10>
<F1>002</F1>
<F2>NR:111880</F2>
</R10>
</RECORDS>
and this is output:
<RECORDS>
<RECORD>
<R10>
<F1>001</F1>
<F2>DT:13.03.11/23:08:45</F2>
</R10>
<R10>
<F1>002</F1>
<F2>NR:111879</F2>
</R10>
<R10>
<F1>003</F1>
<F2>NR:1</F2>
</R10>
<R10>
<F1>004</F1>
<F2>NR:1</F2>
</R10>
</RECORD>
<RECORD>
<R10>
<F1>001</F1>
<F2>DT:13.03.11/23:08:46</F2>
</R10>
<R10>
<F1>002</F1>
<F2>NR:111880</F2>
</R10>
</RECORD>
</RECORDS>
Hello,
Try the below UDF.
Input the values of F1 field in a single context.
int i;
for(i=0;i<F1.length;i++)
{
if(i==0 && F1<i>.equals("001")
{
result.addValue(F<i>);
}
else
{
if(F<i>.equals("001"))
{
result.addContextChange();
result.addValue(F1<i>);
}
else
{
result.addValue(F1<i>);
}
}
}
-Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
more difficult
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello again...
i'm still working with this interface and something changed.
so the input data change as follow:
the record <RECORDS> have not occurrences 1-1 but 1-umbounded.
So a example of input can be like this:
<TABLE>
<RECORDS>
<R10>
<F1>001</F1>
<F2>position 1-1</F2>
</R10>
<R10>
<F1>002</F1>
<F2>NR:111879</F2>
</R10>
<R10>
<F1>001</F1>
<F2>*position 1-2*</F2>
</R10>
<R10>
<F1>002</F1>
<F2>*NR:111880*</F2>
</R10>
</RECORDS>
<RECORDS>
<R10>
<F1>001</F1>
<F2>*position 2-1*</F2>
</R10>
<R10>
<F1>002</F1>
<F2>NR:111879</F2>
</R10>
</RECORDS>
</TABLE>
my problem is that in my output i found all fields inside <RECORD> under the first <RECORDS>.
(like this)
<TABLE>
<RECORDS>
<RECORD>
(*position 1-1*)
</RECORD>
<RECORD>
(position 1-2)
</RECORD>
<RECORD>
(*position 2-1*)
</RECORD>
</RECORDS>
<RECORDS>
(empty)
</RECORDS>
</TABLE>
i tried to change context but no good result. So this function seems work only when i have only one <RECORDS> in my file.
Maybe i need change UDF?
Or map in different mode <RECORD>
I hope explained me clearly.
Any suggestion will be appreciated. Thanks
Alex
Edited by: apederiva on May 20, 2011 2:53 PM
Edited by: apederiva on May 20, 2011 2:54 PM
Hi,
Create Duplicate subtree at receiver side for the node RECORD, and map one to one mapping.
Hope this helps.
Regards,
P.Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.