I see this in the docs:<br><br>&quot;A <a class="indexterm" name="d0e1997"></a>Predicate constraint can use any valid Java expression
        as long as it evaluated to a primitive boolean - avoid using any
        Drools keywords as Declaration identifiers. Previously bound
        declarations can be used in the expression. Functions used in a
        Predicate Constraint must return time constant results.&quot;<br><br>and under the discussion of &#39;eval&#39;:<br><br>&quot;Evals cannot be indexed and thus are not as optimal as using Field
      Constraints.&quot;<br><br>and this in general discussion of constraints and accessors of your objects used in them:<br><br>&quot;Do please make sure that you are accessing methods that take no
      parameters, and are in-fact &quot;accessors&quot; (as in, they don&#39;t change the
      state of the object in a way that may effect the rules - remember that
      the rule engine effectively caches the results of its matching inbetween
      invocations to make it faster).&quot;<br><br>So, if invoking a helper method is like an eval, I&#39;m thinking Drools computes the match, but then throws it away because it knows this is not a constant expression.&nbsp; Whereas, if it were just a match of an accessor&#39;s value vs. a constant String, it could cache that.
<br><br>I&#39;m wildly speculating, only because I want to understand fully what is happening, so I&#39;m throwing stuff out there so the Drools team will have to correct my misapprehensions before I confuse the whole list (*g*).&nbsp; Sometimes reading the Drools documentation is like a Talmudic scholar trying to find the deeper meaning of the sacred words...&nbsp; as much as I want the 
3.2 milestone, I want real documentation even more (and *hint hint* -- would probably be willing to pay for it, guys!&nbsp; Can we get an O&#39;Reilly book?)<br><br>&nbsp; --- Michael<br><span class="e" id="q_110b81fae178c623_1"><span>
</span></span><br><div><span class="gmail_quote">On 2/12/07, <b class="gmail_sendername">Steven Williams</b> &lt;<a href="mailto:stevenw@objectconsulting.com.au">stevenw@objectconsulting.com.au</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I believe there is a caveat on functions and helper methods called from the LHS that they need to be constant over time (or at least over the life of the working memory) which then allows matches to be computed as per normal.
<br><br>Steve<div><span class="e" id="q_110b81fae178c623_1"><br><br><div><span class="gmail_quote">On 2/13/07, <b class="gmail_sendername">Michael Suzio</b> &lt;<a href="mailto:msuzio@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
msuzio@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The JBoss guys can correct me if I&#39;m wrong, but although I think that works, what you&#39;ve just done is eliminate any chance to precompute matches and trim down the checks that need to happen to find a rule match.&nbsp; Since the engine can&#39;t know that 
Helper.transform(&quot;value&quot;) returns a constant value, it has to re-run that every time and it has to reject for matches to the rule constraint every time.<br><br>I&#39;m sure this would really sink performance, in other words.&nbsp; You can easily see the effect -- write the rule this way and time it, and then write it with the return value of 
Helper.transform being inlined, and I&#39;m sure there&#39;s a big difference.&nbsp; It&#39;s the same as any other eval(...) situation in Drools; possible, but not good for performance.<div><span>
<br><br><div><span class="gmail_quote">On 2/12/07, 
<b class="gmail_sendername">Olenin, Vladimir (MOH)</b> &lt;<a href="mailto:Vladimir.Olenin@moh.gov.on.ca" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Vladimir.Olenin@moh.gov.on.ca</a>&gt; wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I was wondering if calls to a Helper class are allowed in LHS of the rule?<br>Eg:<br><br>Rule myRule<br>When<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MyObject(objField == Helper.transform(&quot;value&quot;))<br>Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // smth<br>End
<br><br><br>Thanks,<br><br>Vlad<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></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></div>

<br><br clear="all"><br></span></div>-- <br>Steven Williams<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501<br><a href="mailto:stevenw@objectconsulting.com.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
stevenw@objectconsulting.com.au
</a><br><a href="http://www.objectconsulting.com.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.objectconsulting.com.au</a><br><br>consulting | development | training | support<br>our experience makes the difference
<br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div><br>