on 07-16-2008 4:00 PM
Hi Experts,
Coud anyone help me to map the below requirement:
Source structure :
B................................(0..unbounded)
-satzart (0..1)
-Index (0..1)
-Fehlercode (0..1)
Target structure :
A.............(0..unbounded)
-satzart (0..1)
-rgnumber (0..1)
-Fehlercode1 (0..1)
-Fehlercode2 (0..1)
-Fehlercode3 (0..1)
Source file:
<B>
<Satzart>G60</Satzart>
<Index>B</Index>
<Fehlercode>12D1 ME9999W</Fehlercode>
<B>
<B>
<Satzart>G60</Satzart>
<Index>B</Index>
<Fehlercode>12J1 ME9999W</Fehlercode>
</B>
<B>
<Satzart>G60</Satzart>
<Index>B</Index>
<Fehlercode>50A1 ME5000W</Fehlercode>
</B>
The above file has to be mapped to the target structure like follows:
<A>
<Satzart>G60</Satzart>
<rgnumber>B</rgnumber>
<Fehlercode1>12D1 ME9999W</Fehlercode1>
<Fehlercode2>12J1 ME9999W</Fehlercode2>
<Fehlercode3>50A1 ME5000W</Fehlercode3>
</A>
the source field Fehlercode under B node has to be mapped to the target fehlercode1,fehlercode2,fehlercode3.
i.e: the first occurrence from source has to be mapped to Fehlercode1
and second occurrence has to be mapped to Fehlercode2
and third occurrence has to be mapped to Fehlercode3
If more than three occurrence the next can be ignoredu2026
Please help me how to achieve this in mapping.
Regards,
RDS
Edited by: Shankar Raju Devadoss on Jul 16, 2008 5:00 PM
Edited by: Shankar Raju Devadoss on Jul 16, 2008 5:01 PM
Hi,
Use the following UDF to achieve this requirement:
UDF_1(source Fehlercode queue, index number){
return fehlercode(index no);
}
This is the UDF for Fehlercode1. Use the similar UDF for remaining target fields with changing the index numbers respectively.
Regards
Bhanu.
Edited by: Bhanu Tiruveedula on Jul 16, 2008 10:05 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shankar,
Please try this
satzart --> Satzart
Index --> rgnumber
Fehlercode -->RemoveContext >CopyValue[0]> Fehlercode1
Fehlercode -->RemoveContext >CopyValue[1]> Fehlercode2
Fehlercode -->RemoveContext >CopyValue[2]> Fehlercode3
You can find CopyValue under Constants function. If it doesn't help then let me know.
Thanks,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Map
Satzart --- > satzart
Index -
> rgnumber
For 3rd field Create UDF of type Queue,
ForFirstField(String val[])
{
result.addValue(val[0]);
}
ForSecondField(String val[])
{
result.addValue(val[1]);
}
ForThirdField(String val[])
{
result.addValue(val[2]);
}
Here the UDF is of Queue type so we can add return value to result.
Here you can map ForFirstField udf to Fehlercode1.
Here you can map ForSecondField udf to Fehlercode2.
Here you can map ForThirdField udf to Fehlercode3.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use the following UDFs to achieve this requirement:
UDF_1(source Fehlercode queue){
return fehlercode(1);
}
UDF_2(source Fehlercode queue){
return fehlercode(2);
}
UDF_3(source Fehlercode queue){
return fehlercode(3);
}
Use these three UDFs for three target fields.
Regards
Bhanu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Write an UDF to get this.
Input is the array for B->Fehlercode and
the index_number (1,2,3)
return a[index_number]. (Here a is the array name for the input 1)
Use this java UDF function with index_number as 1 for first 2 for the second and 3 for the third.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
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.