Very interesting. I tried it too , I dont think its about the &#39;==&#39; because it seems to be working for eval( reason == &#39;override&#39;). 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><br>Jai <br><br><div class="gmail_quote">On Feb 7, 2008 5:43 PM, ST &lt;<a href="mailto:super_thunder2@hotmail.com">super_thunder2@hotmail.com</a>&gt; 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. &nbsp;The following is the<br>modified version of the rules.<br><div class="Ih2E3d"><br>rule &quot;Remove smaller or non-overriden&quot;<br> &nbsp; &nbsp;dialect &quot;java&quot;<br>
 &nbsp; &nbsp;when<br> &nbsp; &nbsp; &nbsp; &nbsp;L : Response( $r : value &amp;&amp; status != &quot;override&quot; )<br></div> &nbsp; &nbsp; &nbsp; &nbsp;Response( &nbsp;value &gt; $r || eval (status.equals(&quot;override&quot;)) )<br> &nbsp; &nbsp;then<br> &nbsp; &nbsp; &nbsp; &nbsp;System.out.println(&quot;Retracting &quot; + L);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;retract( L );<br>end<br><br>The Response class has two fields one is value and the other is status. &nbsp;For<br>convenience, I added a constructor where the first parameter is the value and<br>the second is the status. &nbsp;I have added the following objects into the working<br>
memory for testing.<br><br> &nbsp; &nbsp; &nbsp; &nbsp;final Response response1 = new Response(5,&quot;override&quot;);<br> &nbsp; &nbsp; &nbsp; &nbsp;final Response response2 = new Response(6,&quot;not override&quot;);<br> &nbsp; &nbsp; &nbsp; &nbsp;final Response response3 = new Response(7,&quot;not override&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;final Response response4 = new Response(8,&quot;not override&quot;);<br> &nbsp; &nbsp; &nbsp; &nbsp;session.insert( response1 );<br> &nbsp; &nbsp; &nbsp; &nbsp;session.insert( response2 );<br> &nbsp; &nbsp; &nbsp; &nbsp;session.insert( response3 );<br> &nbsp; &nbsp; &nbsp; &nbsp;session.insert( response4 );<br>
<br> &nbsp; &nbsp; &nbsp; &nbsp;session.fireAllRules();<br><br>The result shows that the object, Response(5,&quot;override&quot;), is the only one left<br>after the all activated rules have been evaluated.<br><br>I am not sure why &quot;==&quot; does not work in this example. &nbsp;Is this a known bug?<br>
<div><div></div><div class="Wj3C7c"><br><br><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>