<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Considering that googling on "rule latch" will return this thread on gmane as the 2nd link, you might find research difficult. :)&nbsp; I think Tom coined that term in this context, but it fits.&nbsp; The basic idea is that you use an object as an indicator of what processing has happened, and whether or not rules should fire.<br><br>class RuleLatch {<br>&nbsp; public final String name;<br>&nbsp; public final DataObject dataObject;<br>&nbsp; public RuleLatch(String name, DataObject dataObject) { <br>&nbsp;&nbsp;&nbsp; this.name = name; this.dataObject = dataObject;<br>&nbsp; }<br>}<br><br>when <br>&nbsp; data: DataObject(...selection conditions for data...)<br>&nbsp; level1Latch: RuleLatch(name == "level1Foo", dataObejct == data)<br>&nbsp; level2Latch: RuleLatch(name == "level2Bar", dataObject == data)<br>then<br>&nbsp; ...if this rule wants to cancel all
 subsequent "level1Foo" it retracts level1Latch...<br>
&nbsp; ...if this rule wants to cancel all subsequent "level2Bar" it retractslevel2Latch...<br>end<br><br>An alternative, more efficient, but not as OO happy way, is to put the control information into the DataObject itself.&nbsp; Drools does a lot of optimization on the == tests with hashing, but if speed is a priority it might not be enough.&nbsp; So...<br><br>class DataObject {<br>&nbsp; public boolean level1Foo = true;<br>
&nbsp; public boolean level2Bar = true;<br>}<br><br>when <br>
&nbsp; data: DataObject(level1Foo == true, level2Bar == true, ...selection conditions for data... )<br>then<br>
&nbsp; ...if this rule wants to cancel all subsequent "level1Foo" it updates level1Foo = false...<br>

&nbsp; ...if this rule wants to cancel all subsequent "level2Bar" it updates level2Bar = false...<br>
end<br><br><br><br>--- On <b>Thu, 7/22/10, tom ska <i>&lt;tiberium.linux@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: tom ska &lt;tiberium.linux@gmail.com&gt;<br>Subject: Re: [rules-users] Problem with DRL language/ XLS decision tables.<br>To: "Rules Users List" &lt;rules-users@lists.jboss.org&gt;<br>Date: Thursday, July 22, 2010, 11:50 AM<br><br><div id="yiv952339375"><br>Thanks for reacting ;)<br>I did some simulations, and after them, I want of course to parallelize this process of processing 2 billions facts. But as far as I wrote, Drools engine, can't do this. And I have to create threads manually in application (with pool of sessions). Am I right? Tuning number of data sounds fine to me, so I will try method with "rule latch" too (but I have to read about this, because, I don't know what is it, and I don't want to waste your time ;) But still I don't know
 how to use StatefulSessions to do this...<br>
<span id="result_box" class="short_text"><span style="background-color: rgb(255, 255, 255);" title="">Summarising</span></span>, there are 3 methods to do, what I want to do (apart of a scalability problem - yet ;)<br>1.)with StatelessSession for one fact at time and "activation group"<br>
2.)"rule latch" - I have to read more about it<br>3.)with a pool of StatefulSessions<span id="result_box" class="short_text"><span style="background-color: rgb(255, 255, 255);" title=""></span></span> that I reuse - but I still don't know how to do it using StatefulSessions<span id="result_box" class="short_text"><span style="background-color: rgb(255, 255, 255);" title=""></span></span><br>
Really thanks for help ;)<br><br><br>P.S. I use Drools 5 :)<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

      <br>_______________________________________________<br>
rules-users mailing list<br>
<a rel="nofollow" ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="/mc/compose?to=rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a rel="nofollow" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote><br></div><br>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org" href="/mc/compose?to=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></blockquote></td></tr></table><br>