on 05-24-2010 8:31 AM
Hello gurus,
Please help me with the following scenario.
I have a node with multiple elements in the source message like this;
Source_message
node1
ele1
ele2
ele3
Assume the value of ele1, ele2 ele3 as 1,2 and 3.
target_message
node1
ele
need an udf which can convert all the elements into single node arrey into target message
target_message
node1
1 2 3
Please let me know if any one had tried out similar UDF.
Thanks
sneha
Hi Snehalatha,
Use below code
public voidcalculate(String var1, ResultList result, Container container)
StringBuffer sb = new StringBuffer();
for(int i = 0; i<var1.length;i++)
{
sb.append(var1<i>);
}
result.addValue(sb.toString());
Note:- select advanced userdefined function that means in PI7.1 function catagory is all values of context.
and select source node context to root node.
thanks,
madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sneha
It is simple, you can use multiple concat() functions or
you can use this simple java code.
return a + b + c + .......
Hope this will solve your purpose
Subba Rao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can use concat (Text) function for this
ele1
-- > Concat ----->
ele2
--concat----> Target
ele3-------------->
Regards
Ramg
Edited by: Ramkumar Ganesh on May 24, 2010 8:43 PM
Edited by: Ramkumar Ganesh on May 24, 2010 8:44 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Sneha,
You can use standard function CONCAT.
ELE1 concat ELE2 then concat this output with ELE 3.
Use space as the delimiter of CONCAT.
Thanks,
Uaruna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sneha,
No need of UDF here, you can use the standard node function Concat for this requirement. You need to use it twice in the mapping
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.