cancel
Showing results for 
Search instead for 
Did you mean: 

UDF problem with value comparison

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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