<div dir="ltr"><br>&nbsp;&nbsp; Ron, if your global is set before ***asserting facts**** to the working memory and not changed anymore, you can use it. <br>&nbsp;&nbsp; Also, make sure your array or whatever is an attribute of a class, and so has some semantic to it.<br>
<br>&nbsp;&nbsp; You can do things like this:<br><br>when<br>&nbsp;&nbsp;&nbsp; MyArrayContainer( $flags : flags )<br>&nbsp;&nbsp;&nbsp; Number( intValue &gt;= SOME_GLOBAL_THRESHOLD ) from <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; accumulate( $f : Flag( value == SOME_GLOBAL_VALUE ) from $flags,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count( $f ) )<br>then<br>&nbsp;&nbsp; // threshold met<br>end<br><br>&nbsp; &nbsp; Another options is just create a holder class for your globals and assert it as a fact instead of using globals:<br><br>when<br>&nbsp;&nbsp;&nbsp; MyParameters( $threshold : threshold, $value : value )<br>

&nbsp;&nbsp;&nbsp; MyArrayContainer( $flags : flags )<br>
&nbsp;&nbsp;&nbsp; Number( intValue &gt;= $threshold ) from <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; accumulate( $f : Flag( value == $flags ) from $flags,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count( $f ) )<br>
then<br>
&nbsp;&nbsp; // threshold met<br>
end<br>&nbsp;
<br><br>&nbsp;&nbsp;&nbsp; Hope it helps,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br><br><div class="gmail_quote">2008/7/23 Ron Kneusel &lt;<a href="mailto:oneelkruns@hotmail.com">oneelkruns@hotmail.com</a>&gt;:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Mike,<br>
<br>
I think the collect will work, I&#39;ll have to look at it more closely because the ordering of elements in the array is significant so I&#39;m not sure I can just break the elements up into facts and let collect group them however it will.<br>

<br>
As a follow up, while my solution of using a global in the LHS works, is the problem with changing the global simply that the engine will not see the changes? &nbsp;For my case, the global is set before the rules engine is called and it will not change while the engine runs.<br>

<br>
Ron<br>
<div class="Ih2E3d"><br>
Mike wrote:<br>
<br>
&gt;Have a look at the &quot;Alarms&quot; example for &quot;Collect&quot; in the (4.0.5) manual.<br>
&gt;<br>
&gt;This should give you a good starting point.<br>
&gt;<br>
&gt;Cheers,<br>
&gt;<br>
&gt;Mike<br>
<br>
</div>_________________________________________________________________<br>
With Windows Live for mobile, your contacts travel with you.<br>
<a href="http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mobile_072008" target="_blank">http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mobile_072008</a><br>
<div><div></div><div class="Wj3C7c">_______________________________________________<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>
</div>