<br>   A DRL constraint is always:<br><br>&lt;fieldName&gt; &lt;operator&gt; &lt;restriction_list&gt;<br><br>   So the correct is even when dealing with booleans to explicitly state your intent:<br><br>myClass : MyClass( myBoolean == true )<br>
<br>   An eval is any valid java/mvel expression that returns a boolean, and that is why it works without the explicit comparison to null.<br><br>   []s<br>   Edson<br> <br><div class="gmail_quote">2009/5/3 lightbulb432 <span dir="ltr">&lt;<a href="mailto:veerukrishnan@hotmail.com">veerukrishnan@hotmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
The simplified syntax you describe doesn&#39;t seem to work in Drools 4<br>
(drools-core.jar and drools-compiler.jar, both version 4.0.4):<br>
<br>
package MyClassRules;<br>
dialect &quot;mvel&quot;<br>
<br>
import com.myclass.MyClass;<br>
<br>
rule Works<br>
when<br>
  myClass : MyClass()<br>
  eval(myClass.myBoolean)<br>
then<br>
  System.out.println(&quot;This means myBoolean is true&quot;);<br>
end;<br>
<br>
rule DoesntWork<br>
when<br>
  myClass : MyClass(myBoolean)<br>
then<br>
  System.out.println(&quot;This means myBoolean is true&quot;);<br>
end;<br>
<br>
The first rule above is fired and the message is printed to the console, as<br>
expected, but not the second rule. The above is my rule file in its<br>
entirety. What&#39;s going wrong here - the file compiles fine, so I&#39;m guessing<br>
there&#39;s no problem with the syntax?<br>
<div><div></div><div class="h5"><br>
<br>
<br>
Edson Tirelli-3 wrote:<br>
&gt;<br>
&gt;    The &quot;arrow&quot; is an old syntax from the Drools 3.0 times that is no<br>
&gt; longer<br>
&gt; necessary and was deprecated in 4. It is the exact same thing as a<br>
&gt; bind+eval:<br>
&gt;<br>
&gt; MemberBlog(member : member -&gt; (member.getUsername().equals(<br>
&gt; principal.getName())))<br>
&gt;<br>
&gt;    Above is exact same thing as:<br>
&gt;<br>
&gt; MemberBlog(member : member, eval(member.getUsername().equals(<br>
&gt; principal.getName())))<br>
&gt;<br>
&gt;    But in Drools 4 and 5, that can be simplified to:<br>
&gt;<br>
&gt; MemberBlog( member.username == <a href="http://principal.name" target="_blank">principal.name</a> )<br>
&gt;<br>
&gt;    Much cleaner as you can see.<br>
&gt;<br>
&gt;    []s<br>
&gt;    Edson<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 2009/5/1 lightbulb432 &lt;<a href="mailto:veerukrishnan@hotmail.com">veerukrishnan@hotmail.com</a>&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; What does the arrow (&quot;-&gt;&quot;) mean in a rule file? I&#39;ve searched on Google,<br>
&gt;&gt; looked through the Drools documentation, and haven&#39;t been able to find<br>
&gt;&gt; out<br>
&gt;&gt; what it does.<br>
&gt;&gt;<br>
&gt;&gt; It appears in the autocomplete of my IDE for Drools, and I&#39;ve seen it in<br>
&gt;&gt; an<br>
&gt;&gt; example in the JBoss Seam documentation, but am unable to tell what it<br>
&gt;&gt; does:<br>
&gt;&gt;<br>
&gt;&gt; rule InsertMemberBlog<br>
&gt;&gt;  no-loop<br>
&gt;&gt;  activation-group &quot;permissions&quot;<br>
&gt;&gt; when<br>
&gt;&gt;  principal: Principal()<br>
&gt;&gt;  memberBlog: MemberBlog(member : member -&gt;<br>
&gt;&gt; (member.getUsername().equals(principal.getName())))<br>
&gt;&gt;  check: PermissionCheck(target == memberBlog, action == &quot;insert&quot;, granted<br>
&gt;&gt; == false)<br>
&gt;&gt; then<br>
&gt;&gt;  check.grant();<br>
&gt;&gt; end;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://www.nabble.com/What-does-the-arrow-%28%22-%3E%22%29-mean-in-a-rule-file--tp23341009p23341009.html" target="_blank">http://www.nabble.com/What-does-the-arrow-%28%22-%3E%22%29-mean-in-a-rule-file--tp23341009p23341009.html</a><br>

&gt;&gt; Sent from the drools - user mailing list archive at Nabble.com.<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt;  Edson Tirelli<br>
&gt;  JBoss Drools Core Development<br>
&gt;  JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
<br>
--<br>
</div></div>View this message in context: <a href="http://www.nabble.com/What-does-the-arrow-%28%22-%3E%22%29-mean-in-a-rule-file--tp23341009p23354001.html" target="_blank">http://www.nabble.com/What-does-the-arrow-%28%22-%3E%22%29-mean-in-a-rule-file--tp23341009p23354001.html</a><br>

<div><div></div><div class="h5">Sent from the drools - user mailing list archive at Nabble.com.<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><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>