on 04-25-2008 5:44 PM
i have this problem, but i dont know how to make it
Source
-
<rs>
<row>
<PEOSN>2020202</PEOSN>
<PEDET>sku01,10;sku02,12;</PEDET>
</row>
<row>
<PEOSN>2020203</PEOSN>
<PEDET>sku11,12;sku15,13;sku09,14;</PEDET>
</row>
</rs>
Target
-
<detail>
<item>
<number>2020202</number>
<sku>sku01</sku>
<value>10</value>
</item>
<item>
<number>2020202</number>
<sku>sku02</sku>
<value>12</value>
</item>
<item>
<number>2020203</number>
<sku>sku11</sku>
<value>12</value>
</item>
<item>
<number>2020203</number>
<sku>sku15</sku>
<value>13</value>
</item>
<item>
<number>2020203</number>
<sku>sku09</sku>
<value>14</value>
</item>
</detail>
i have already used this reference
Hi !
Check this screenshots:
http://picasaweb.google.es/matiwork/Levy_gonzalez_xi
it's the solution for your scenario.
you have here the mapping and code for the UDFs.
Regards,
Matias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi !
You should use several UDFs to reach your goal...for example
one advanced UDF called "getNumber" that receives as input parameter the PEOSN and PEDET fields, and outputs as many repetitions of the PEOSN value as ";" are in the PEDET parameter..it should output a queue and should link the output value array to the "number" and "item" nodes in the target message.
another advanced UDF called "getSKU" that receives as input the PEDET field and returns as output, an array with the "sku" part of the input PEDET field. This udf should fill the target field "sku".
another advanced UDF called "getValue" that does the same as "getSKU" but only with the "value" portion of each sku+value pair.
Use javascript code like
String[] values = a[0].split(";");
for(int i=0; i<values.length; i++){
result.addValue(values<i>);
}
to fill the output value array based on how many pairs are in the PEDET field (inside the udf it is referenced as a[0]).
Regards,
Matias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.