on 12-02-2009 4:15 PM
Dear Experts,
as I am not a Java-expert I need your help. I created a UDF (type ""QUEUE", also tried "CONTEXT" but did not work), which accepts 3 parameters from my input-XML file. For some reason, from the UDF I always get the value "O" back, even if for instance the Billingstatus1 = C.
In message-mapping, I mapped the node "BillingStatus1" directly to the input parameter of the UDF. The same goes for the other parameters.
Code of UDF:
if(BillingStatus1.equals("C") | BillingStatus2.equals("C"))
{
result.addValue("I");
}
else if(DeliveryStatus.equals("C"))
{
result.addValue("S");
}
else {
result.addValue("O");
}
Can anybody please tell me what I am doing wrong here?
Thanks in advance!
William
Edited by: JWD on Dec 2, 2009 5:22 PM
Hi,
UDF looks like mixture of the contexts....
if it is QUEUE then arrays will be passed to the UDF you need to access the values using index...
i.e BillingStatus1[0]...also logical or is two pipes || not single pipe |
for ( int i=0 ; i<BillingStatus1.length;i++)
{
if(BillingStatus1<i>.equals("C") || BillingStatus2<i>.equals("C"))
{
result.addValue("I");
}
else if(DeliveryStatus<i>.equals("C"))
{
result.addValue("S");
}
else {
result.addValue("O");
}
}
try above code
HTH
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi William,
UDF Code:
> if(for int i=0; i<BillingStatus1.length; i++)
>{
> if(BillingStatus1<i>.equals("C") || BillingStatus2<i>.equals("C"))
> result.addValue("I");
> else if(DeliveryStatus<i>.equals("C"))
> result.addValue("S");
> else
> result.addValue("O");
>}
for single statement then bracess ( '{' and '}' ) are not required also.
Regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
26 | |
10 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.