Hi Ryan,<br><br>How many rule files / flows are we talking about? Is there one &quot;Master&quot; (for want of a better word) flow that controls the entire adjudication process? If so could you have a first step that inserts one fact from a list, moves on to the adjudication process, then loops back until there are no facts left? Should be easy to do with a few decision nodes and maybe an activation group:<br>
<br>[Step 1: Insert fact]<br>[Step 2: Adjudicate]<br>{Decision: have more facts?} - Yes -&gt; Step 1<br>- No -&gt; Step 3<br>[Step 3: Finish]<br><br>If you just have one rule file, maybe you could have a rule with a salience lower than any other that inserts one fact.<br>
<br>rule getStarted<br>salience -1000<br> when<br>  $stack : StackOfStarterFacts(this.size != 0)<br> then<br>  insert($stack.pop());<br>end<br><br>If you assume every other rule depends on these starter facts to execute and have a salience higher than -1000, this could work.<br>
The getStarted rule should fire once at the beginning then again when all other adjudication has finished, restarting the process. <br>This might be harder to maintain.<br><br>Hope it gives you some ideas!<br><br>Enda<br>
<br><div class="gmail_quote">2010/3/11 Ryan Fitzgerald <span dir="ltr">&lt;<a href="mailto:ryan.fitzgerald@ericsson.com">ryan.fitzgerald@ericsson.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">







<div>
<font face="Arial" size="2">
<div>Hi, </div>
<div> </div>
<div>In our application, we want to process a large amount of facts. However, to avoid an overload on memory and drools, we would like to process the facts in batches. </div>
<div> </div>
<div>Our rules are setup so that we only insert a small number of initial or &quot;root&quot; facts, and then these facts trigger rules to fire that cause many other facts to be inserted, themselves triggering other rules. </div>

<div> </div>
<div>One way of batching this would be for the application to only insert the root facts into memory one by one and not inserting the next root fact until the previous one (and the batch of facts associated with it) have been processed and subsequently revoked.
</div>
<div> </div>
<div>However, instead of the batching being controlled by the application, I would like to use a rule to do this i.e. insert all the root facts into memory and then call fireAllRules and have them processed one at a time. </div>

<div> </div>
<div>Does anyone have an idea how I can write a rule that causes a set of facts to trigger their rules, one fact at a time? </div>
<div> </div>
<div>Thanks.</div>
<div> </div>
<div><font face="Arial, sans-serif"> </font></div>
</font>
</div>

<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>
<br></blockquote></div><br><br clear="all"><br>-- <br>Enda J Diggins<br>