<div>Could be there is a race condition in the builder.</div><div><br></div>I would not use a changeset unless you really need dynamic changes of your rules.<div>Simply feed the builder with DRL or whatever, create the Knowledge Base and then</div>
<div>the sessions.</div><div><br></div><div>-W</div><div><br></div><div><br><div class="gmail_quote">On 9 March 2012 17:25, gboro54 <span dir="ltr">&lt;<a href="mailto:gboro54@gmail.com">gboro54@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Perhaps I am building my packages weird but if all my drl/dslr are under the<br>
same package the salience is honored and all the rules are fired in order.<br>
Why would it work in this way? Since changing all the files to the same<br>
package I have done 10 runs of the test with 100% success. Am I building the<br>
kBase in weird manner(I don&#39;t think so but look below):<br>
<br>
<br>
                if (logger.isDebugEnabled()) {<br>
                        logger.debug(&quot;Knowledge base with the following changeset was requested<br>
built &quot;<br>
                                        + changeset);<br>
                }<br>
                KnowledgeBuilder kbuilder = KnowledgeBuilderFactory<br>
                                .newKnowledgeBuilder();<br>
                kbuilder.add(ResourceFactory.newClassPathResource(changeset),<br>
                                ResourceType.CHANGE_SET);<br>
                KnowledgeBuilderErrors errors = kbuilder.getErrors();<br>
                if (errors.size() &gt; 0) {<br>
                        StringBuilder sb = new StringBuilder();<br>
                        for (KnowledgeBuilderError error : errors) {<br>
                                sb.append(error + &quot;\n&quot;);<br>
                                logger.error(error);<br>
                        }<br>
                        throw new IllegalArgumentException(&quot;Could not parse knowledge. \n&quot;<br>
                                        + sb);<br>
                }<br>
                KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();<br>
                kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());<br>
                return kbase;<br>
<br>
Would this cause any fragmenting when the engine is indexing the rules for<br>
activation? I would think not. I am just going by the current results I have<br>
gotten by declaring all rules in the same package.<br>
<br>
<br>
<br>
<br>
laune wrote<br>
<div class="im">&gt;<br>
&gt; Salience is a field in the Activation object, used for ranking another<br>
&gt; entry when it is inserted into the List. Looking at the package name for<br>
&gt; this or at this time would be futile.<br>
&gt; -W<br>
&gt;<br>
</div><div><div class="h5">&gt; On 9 March 2012 16:44, gboro54 &amp;lt;gboro54@&amp;gt; wrote:<br>
&gt;<br>
&gt;&gt; No I am not using CEP and I didn&#39;t think STREAM mode made a difference. I<br>
&gt;&gt; am<br>
&gt;&gt; just as perplexed as you on why this is happening. Could it be salience<br>
&gt;&gt; is<br>
&gt;&gt; only respected in the same package(these are in different packages )? I<br>
&gt;&gt; am<br>
&gt;&gt; just taking a stab in the dark at this point. I generated audit logs and<br>
&gt;&gt; it<br>
&gt;&gt; can be seen that the removal rule activation is created first and<br>
&gt;&gt; executed<br>
&gt;&gt; first(it looks like 75% of the time based on my test this occurs)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; laune wrote<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; It&#39;s difficult to imagine that doing the same thing with equal facts in<br>
&gt;&gt; &gt; identically configured sessions would create differing objects. And it<br>
&gt;&gt; &gt; was the intent of my questions to unearth some irregularity, and to<br>
&gt;&gt; &gt; narrow it down.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; STREAM mode shouldn&#39;t matter as you aren&#39;t using windows, expiry<br>
&gt;&gt; &gt; or other CEP features - or are you?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; -W<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On 9 March 2012 15:53, gboro54 &amp;lt;gboro54@&amp;gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; All sessions are against the same kBase. When I say replicate I mean I<br>
&gt;&gt; &gt;&gt; create<br>
&gt;&gt; &gt;&gt; 10000 separate Orders all the same way(same values for all<br>
&gt;&gt; properties).<br>
&gt;&gt; I<br>
&gt;&gt; &gt;&gt; have not tried to insert all into one session and fire but can try if<br>
&gt;&gt; &gt;&gt; this<br>
&gt;&gt; &gt;&gt; really makes a difference(though I am not sure why it should). I will<br>
&gt;&gt; add<br>
&gt;&gt; &gt;&gt; an<br>
&gt;&gt; &gt;&gt; update to 1 as well but again I am not sure why this would matter to a<br>
&gt;&gt; &gt;&gt; low<br>
&gt;&gt; &gt;&gt; ranking rule who does not care about the actual values from that rule<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; View this message in context:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; <a href="http://drools.46999.n3.nabble.com/Drools-Salience-and-no-loop-tp3812723p3812869.html" target="_blank">http://drools.46999.n3.nabble.com/Drools-Salience-and-no-loop-tp3812723p3812869.html</a><br>
&gt;&gt; &gt;&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; rules-users mailing list<br>
&gt;&gt; &gt;&gt; rules-users@.jboss<br>
&gt;&gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; rules-users mailing list<br>
&gt;&gt; &gt; rules-users@.jboss<br>
&gt;&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://drools.46999.n3.nabble.com/Drools-Salience-and-no-loop-tp3812723p3813013.html" target="_blank">http://drools.46999.n3.nabble.com/Drools-Salience-and-no-loop-tp3812723p3813013.html</a><br>
&gt;&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; rules-users@.jboss<br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; rules-users@.jboss<br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
<br>
--<br>
</div></div>View this message in context: <a href="http://drools.46999.n3.nabble.com/Drools-Salience-and-no-loop-tp3812723p3813137.html" target="_blank">http://drools.46999.n3.nabble.com/Drools-Salience-and-no-loop-tp3812723p3813137.html</a><br>

<div class="HOEnZb"><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</div></div></blockquote></div><br></div>