Hi,<br>I have a rule like:<br><br>rule &quot;Rule1&quot;<br>    when<br>        $fact: Fact1()<br>        $allFacts: ArrayList() from collect(Fact1())<br><br>    then<br>        insert(new Fact2($allFacts.size()));<br>end<br>
<br><br>I want to compute $allFacts inside a function since I will use it across different rules. <br>This doesn&#39;t work because it is not valid Java syntax:<br><br>function int size() {<br>    ArrayList a = ArrayList() from collect(InQueuePredicate());<br>
    return a.size();<br>}<br><br>Could I put this in a named query, and call it from a function?<br><br>Thanks!<br>Miguel<br><br><br><br>