<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. :) I think Tom coined that term in this context, but it fits. 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> public final String name;<br> public final DataObject dataObject;<br> public RuleLatch(String name, DataObject dataObject) { <br> this.name = name; this.dataObject = dataObject;<br> }<br>}<br><br>when <br> data: DataObject(...selection conditions for data...)<br> level1Latch: RuleLatch(name == "level1Foo", dataObejct == data)<br> level2Latch: RuleLatch(name == "level2Bar", dataObject == data)<br>then<br> ...if this rule wants to cancel all
subsequent "level1Foo" it retracts level1Latch...<br>
...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. Drools does a lot of optimization on the == tests with hashing, but if speed is a priority it might not be enough. So...<br><br>class DataObject {<br> public boolean level1Foo = true;<br>
public boolean level2Bar = true;<br>}<br><br>when <br>
data: DataObject(level1Foo == true, level2Bar == true, ...selection conditions for data... )<br>then<br>
...if this rule wants to cancel all subsequent "level1Foo" it updates level1Foo = false...<br>
...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><tiberium.linux@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: tom ska <tiberium.linux@gmail.com><br>Subject: Re: [rules-users] Problem with DRL language/ XLS decision tables.<br>To: "Rules Users List" <rules-users@lists.jboss.org><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>