<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt">i have to be doing something wrong...but it make no sense...<br>a MegaTransferObject is asserted.<br><br>case1: No rules fired.<br><span style="font-weight: bold;">rule "dtv_discount_request"</span><br style="font-weight: bold;"><span style="font-weight: bold;"> when</span><br style="font-weight: bold;"><span style="font-weight: bold;"> MegaTransferObject(other_AccountType == null) or </span><br style="font-weight: bold;"><span style="font-weight: bold;"> MegaTransferObject(other_AccountType == Constants.PHONE_TYPE_RESIDENTIAL)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> MegaTransferObject(other_HasDtvDiscountRequest == false)</span><br style="font-weight:
bold;"><span style="font-weight: bold;"> then</span><br style="font-weight: bold;"><span style="font-weight: bold;"> menu.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL, Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});</span><br style="font-weight: bold;"><span style="font-weight: bold;">end</span><br><br>case 2: no rule fired.<br><br><span style="font-weight: bold;">rule "dtv_discount_request"</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> when</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> MegaTransferObject(other_AccountType == null) or </span><br style="font-weight: bold;">
<span style="font-weight: bold;"> MegaTransferObject(other_AccountType == "RMS")</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> MegaTransferObject(other_HasDtvDiscountRequest == false)</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> then</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> menu.add(new
String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});</span><br style="font-weight: bold;">
<span style="font-weight: bold;">end<br><span style="font-weight: bold;"><span style="font-weight: bold;"></span></span><br></span>case 3: rule fired<br><div> <br><span style="font-weight: bold;">rule "dtv_discount_request"</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> when</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> </span><span style="font-weight: bold;"></span><span style="font-weight: bold;">megaTO:</span><span style="font-weight: bold;">MegaTransferObject</span><span style="font-weight: bold;"></span><span style="font-weight: bold;">(other_AccountType == "RMS")</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> megaTO:</span><span style="font-weight: bold;">MegaTransferObject</span><span style="font-weight: bold;">(other_HasDtvDiscountRequest == false)</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> then</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> menu.add(new
String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});</span><br style="font-weight: bold;">
<span style="font-weight: bold;">end</span><br><br>i really dont get it...<br>i must not be getting something...<br>help...<br><br><br></div>Joel G. Rivera-Gonzalez<br>PRT<br><br>"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Edson Tirelli <tirelli@post.com><br>To: Rules Users List <rules-users@lists.jboss.org><br>Sent: Tuesday, January 9, 2007 7:26:35 AM<br>Subject: Re: [rules-users] About String..."==" same as ".equals"?<br><br><div><br> Joel,<br><br> This is the correct syntax and it works (at least we didn't get a <br>report for it not working yet):<br><br>Object(variable == Constants.value)<br><br> Can you please elaborate about the problem you are having
in order <br>for us to help solving it? If it is a bug we need to fix.<br><br> Thank you,<br> Edson<br><br>Joel G. Rivera-González wrote:<br><br>> most (if not all) of my rules will have conditions like this:<br>> Object(variable == Constants.value)<br>> this is not working...<br>> BUT if i change the Constants.value to corresponding value from the <br>> constants class it will work...<br>> is there any other way other than this Object(a:variable-> <br>> (a.equals(Constants.value)) to do it?<br>><br>><br>><br>> <br>> Joel G. Rivera-Gonzalez<br>> PRT<br>><br>> "The first 90% of a project takes 90% of the time, the last 10% takes <br>> the other 90% of the time" - Murphy's Law<br>><br>>------------------------------------------------------------------------<br>><br>>_______________________________________________<br>>rules-users mailing
list<br>>rules-users@lists.jboss.org<br>><a target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>> <br>><br><br><br>-- <br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3124-6000<br> Mobile: +55 11 9218-4151<br> JBoss, a division of Red Hat @ <a target="_blank" href="http://www.jboss.com">www.jboss.com</a><br><br><br>_______________________________________________<br>rules-users mailing list<br>rules-users@lists.jboss.org<br><a target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></div></div><br></div></div></body></html>