Are the constraints c99999 == &quot;R&quot; true for all Facts of type fact1,...fact5? Is this actually the only constraint?<br><br>The not doesn&#39;t really reduce the network since it is the last pattern. <br><br>I&#39;ll wait for your answer before proposing a solution.<br>
<br>-W<br><br><br><br><div class="gmail_quote">On 22 December 2010 15:34,  <span dir="ltr">&lt;<a href="mailto:rouvas@di.uoa.gr">rouvas@di.uoa.gr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello List,<br>
<br>
Issue: Too many ACTIVATION &quot;candidates&quot;<br>
<br>
Sorry for the terminology, I&#39;m sure it is not correct.<br>
<br>
Background Information:<br>
- Drools.5.0.1<br>
- using StatefulKnowledgeSession<br>
- logging through KnowledgeRuntimeLoggerFactory.newConsoleLogger()<br>
- after each session creation, rules are inserted from a DRL file,<br>
  facts are inserted and ksession.fireAllRules() is executed<br>
- str[contains] and str[bidicontains] are custom operators implemented by me<br>
<br>
If I understand Drools modus operandi correctly, as each fact is inserted<br>
the list of candidate &quot;nodes&quot; to fire are constructed. Upon<br>
fireAllRules(), a selection mechanism selects a candidate &quot;node&quot; to fire<br>
and things start<br>
rolling.<br>
<br>
In my case, the rule at the end results in too many candidate &quot;nodes&quot;<br>
created during facts insertion mode. If the rule ever gets to fire, only<br>
one will remain since the not codition in the LHS and the logicalInserts<br>
in the RHS exclude two firings of the rule (I hope).<br>
<br>
fact1 has about 90 entries.<br>
fact2 has about 25 entries.<br>
fact3 has about 350 entries.<br>
fact4 has about 150 entries.<br>
fact5 has about 250 entries.<br>
<br>
So I&#39;m guessing that 90*25*350*150*250=29.531.250.000, i.e. 29 billion<br>
candidate &quot;nodes&quot; would be created. Of course, I&#39;m having OME long before<br>
that!<br>
<br>
If my analysis is correct, is any way that I could either:<br>
<br>
a) detect that kind of combinatorial explosion during runtime (maybe a<br>
   kind of dry-run) and act accordingly<br>
<br>
or<br>
<br>
b) set any kind of upper limit for candidate &quot;nodes&quot; creation and stop<br>
   further execution thus avoiding to bring down the server along the way...<br>
<br>
rule &quot;r21767.2&quot;<br>
        dialect &quot;mvel&quot;<br>
        when<br>
                gnId : GoodNumbers()<br>
                 v1 : fact1(  c21658 == &quot;R&quot; )<br>
                 v2 : fact2(  c21727 == &quot;R&quot; )<br>
                 v3 : fact3(  c21723 == &quot;R&quot; )<br>
                 v4 : fact4(  c21616 == &quot;R&quot; )<br>
                 v5 : fact5(  c21731 == &quot;R&quot; )<br>
                 v6 : GoodsItems( gnId.goodNo==goodNo ,<br>
                         goodsDescr str[bidicontains] v5.c21733   ||<br>
                         goodsDescr str[bidicontains] v5.c21732   ||<br>
                         goodsDescr str[bidicontains] v4.c21617   ||<br>
                         goodsDescr str[bidicontains] v4.c21619   ||<br>
                         goodsDescr str[bidicontains] v3.c21724   ||<br>
                         goodsDescr str[bidicontains] v2.c21726   ||<br>
                         goodsDescr str[bidicontains] v1.c21656   ||<br>
                         goodsDescr str[bidicontains] v1.c21657   ||<br>
                         goodsUnDangCode str[contains] v1.c21659  ||<br>
                         goodsUnDangCode str[contains] v2.c21728  ||<br>
                         goodsUnDangCode str[contains] v4.c21618  ||<br>
                         goodsUnDangCode str[contains] v5.c21735  ||<br>
                         combinedNome str[bidicontains] v1.c21655 ||<br>
                         combinedNome str[bidicontains] v2.c21729 ||<br>
                         combinedNome str[bidicontains] v4.c21615 ||<br>
                         combinedNome str[bidicontains] v5.c21734<br>
                       )<br>
                not mm : Marker ( mm.entityId==v6.entityID, mm.markAs==&quot;19&quot;)<br>
        then<br>
                modify ( v6 ) {<br>
                        setMarkAs(&quot;1&quot;)<br>
                }<br>
                Marker m1 = new Marker();<br>
                        m1.setEntityId(v6.entityID);<br>
                        m1.setMarkAs(&quot;19&quot;);<br>
                insertLogical(m1);<br>
end<br>
<br>
Thank you very much for your time,<br>
-Stathis<br>
<br>
<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>
</blockquote></div><br>