cancel
Showing results for 
Search instead for 
Did you mean: 

UDF Prob

Former Member
0 Kudos

Hi Guys,

I encountered strange behaviour with UDF.My requirement is simple but clueless when executed.

I have done below program test in eclipse and tested working fine but when used the same logic in Mapping UDF executes but always same default result gets reflected

If (Condition1)

{

Return1;

}

else if (Condition2)

{

Return2;

}

else

return " ";

When i execute even if condition is statisfied it comes to the return " " value always

Any help on this issue , am i missing any where ??

thax for help

Regards

Srinivas

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Venkateswarlu,

It's very simple; In Java you compare strings with the "equals" method. For example to compare strings s1 s2, use the following code:

if (s1.equals(s2))

{

}

else

{

}

When you use the == operator, it checks whether this is a reference to the same object instance, which of course it isn't.

Former Member
0 Kudos

Hi,

Thx s it worked .Point noted

Srini

Former Member
0 Kudos

Hi venkat,

Paste the payload of XML message in the message mapping test and use the display queue option to check what values are reflecting.

if its working fine but when u send a message end end .. its not working...

just click the change button on message mapping and save and active it.... it may work !!!

SudhirT
Active Contributor
0 Kudos

Hi,

Check in Display queue whether the values coming in queue satisfies the condition, or for test check with simple constant values as input.

Thanks!

Former Member
0 Kudos

Try putting the condition as negative...

Former Member
0 Kudos

Hi ,

Negative condition worked

but y it was not working with positive condition Check.

if ( s == "1") ---> Not Working Executes last else statement.

if ( s!= "1" ) --> Works

In display Queue i see Sender sends 1 but still doesnot work with Positive . i even trimed using trim().

Any idea on this only negative works

Srini