on 01-20-2009 6:56 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 !!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try putting the condition as negative...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.