Below is a self-contained DRL showing the effect. Please note that the dialect rule attribute isn&#39;t really important. If you use &quot;$p.getName()&quot; to retrieve the name, the call is made once; as soon as you use just &quot;name&quot;, the matchXXX is called twice.<br>
<br>To run, compile, create a session, fireAllRules.<br><br>-W<br><br>package mvelmvel;<br><br>declare Person<br>   name: String<br>   age:  int<br>end<br><br>function boolean matchJava(String s1, String s2){<br>    System.out.println( &quot;matchJava: &quot; + s1 + &quot;==&quot; + s2 );<br>
    return s1.equals( s2 );<br>}<br>function boolean matchMVEL(String s1, String s2){<br>    System.out.println( &quot;matchMVEL: &quot; + s1 + &quot;==&quot; + s2 );<br>    return s1.equals( s2 );<br>}<br><br>rule init<br>
salience 100<br>when<br>then<br>    Person p = new Person( &quot;Joe&quot;, 42 );<br>    insert( p );<br>end<br><br>rule testMVEL<br>dialect &quot;mvel&quot;<br>when<br>    $p: Person( matchMVEL( name, &quot;Joe&quot; ) == true &amp;&amp; age &gt; 40 )<br>
then<br>    System.out.println( &quot;testMVEL: old Joe&quot; );<br>end<br><br>rule testJava<br>dialect &quot;java&quot;<br>when<br>    $p: Person( matchJava( $p.getName(), &quot;Joe&quot; ) == true &amp;&amp; age &gt; 40 )<br>
then<br>    System.out.println( &quot;testJava: old Joe&quot; );<br>end<br><br><br><br><div class="gmail_quote">On 5 January 2012 16:50, ronalbury <span dir="ltr">&lt;<a href="mailto:ronalbury@gmail.com">ronalbury@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204,204,204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">Mark:  I know what Jira is ... but I don&#39;t know what you mean by a pull<br>
request ... I also don&#39;t have it set up as a JUnit test.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Error-in-MVEL-execution-optimization-tp3633440p3635295.html" target="_blank">http://drools.46999.n3.nabble.com/Error-in-MVEL-execution-optimization-tp3633440p3635295.html</a><br>

</font></span><div class="HOEnZb"><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<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>