on 06-02-2015 11:17 PM
Hi Experts,
My source Payload is below:
<EmpID_Source>
<Item>
<EmpID>11314 123456 1678901 14789123</EmpID>
</Item>
</EmpID_Source>
I need the Target Payload as below:
<EmpID_Target>
<Item>
<EmpID>11314</EmpID>
<EmpID>123456</EmpID>
<EmpID>1678901</EmpID>
<EmpID>14789123</EmpID>
</Item>
</EmpID_Target>
EmpdId Filed in the Source Payload has the 4 Numbers Seperated by Space.
<EmpID>11314 123456 1678901 14789123</EmpID>
EmpdId Filed on Target should be dynamically created based on the SOurce Emp Field.
Please gudie me how can i achieve the udf for this.
Thank you,
Regards,
GIRIDHAR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Giridhar,
Write a UDF (values of context) with below for loop.
public void udf_split(String[] EmpID, ResultList EmpID_out, Container container) throws StreamTransformationException {
for (String empID : EmpID[0].split(" ")) {
EmpID_out.addValue(empID);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.