<br> This is fixed on 4.0.x branch. I will fix in trunk.<br><br> []s<br> Edson<br><br><div><span class="gmail_quote">2008/2/8, Edson Tirelli <<a href="mailto:tirelli@post.com">tirelli@post.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br> Ok, I see the problem. It is a bug that happens when mixing alpha and beta constraints under ||.<br> I will fix it.<br><br> []s<br> Edson<br><br> <br><br><div><span class="gmail_quote">2008/2/8, Jai Vasanth <<a href="mailto:jaivasanth@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jaivasanth@gmail.com</a>>:</span><div>
<span class="e" id="q_117fa5ca5ee94817_1"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Sorry... eval(reason == 'override') is not the right way to check for string equality doh. Yes yours is definitely the way to go. I have had the '==' work for many cases. In this case it seems to be not working when there are multiple boolean disjunctions along with them.<br>
<span>
<br>Jai </span><div><span><br><br><div class="gmail_quote">On Feb 8, 2008 8:52 AM, Jai Vasanth <<a href="mailto:jaivasanth@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jaivasanth@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Very interesting. I tried it too , I dont think its about the '==' because it seems to be working for eval( reason == 'override'). So it is more to do with having the eval method call. <br>Nice find. Not too sure if this is a bug, or if there is a reason why drools works this way.<br>
<br><br>Thanks<br><font color="#888888"><br>Jai </font><div><div></div><div><br><br><div class="gmail_quote">On Feb 7, 2008 5:43 PM, ST <<a href="mailto:super_thunder2@hotmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">super_thunder2@hotmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I got it working by using the inline eval expression. The following is the<br>modified version of the rules.<br><div><br>rule "Remove smaller or non-overriden"<br> dialect "java"<br>
when<br> L : Response( $r : value && status != "override" )<br></div> Response( value > $r || eval (status.equals("override")) )<br> then<br> System.out.println("Retracting " + L);<br>
retract( L );<br>end<br><br>The Response class has two fields one is value and the other is status. For<br>convenience, I added a constructor where the first parameter is the value and<br>the second is the status. I have added the following objects into the working<br>
memory for testing.<br><br> final Response response1 = new Response(5,"override");<br> final Response response2 = new Response(6,"not override");<br> final Response response3 = new Response(7,"not override");<br>
final Response response4 = new Response(8,"not override");<br> session.insert( response1 );<br> session.insert( response2 );<br> session.insert( response3 );<br> session.insert( response4 );<br>
<br> session.fireAllRules();<br><br>The result shows that the object, Response(5,"override"), is the only one left<br>after the all activated rules have been evaluated.<br><br>I am not sure why "==" does not work in this example. Is this a known bug?<br>
<div><div></div><div><br><br><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</span></div><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></span></div>
</div><span class="sg"><br>
<br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.jboss.com</a>
</span></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>