<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"><<a href="mailto:gboro54@gmail.com">gboro54@gmail.com</a>></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't think so but look below):<br>
<br>
<br>
if (logger.isDebugEnabled()) {<br>
logger.debug("Knowledge base with the following changeset was requested<br>
built "<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() > 0) {<br>
StringBuilder sb = new StringBuilder();<br>
for (KnowledgeBuilderError error : errors) {<br>
sb.append(error + "\n");<br>
logger.error(error);<br>
}<br>
throw new IllegalArgumentException("Could not parse knowledge. \n"<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">><br>
> Salience is a field in the Activation object, used for ranking another<br>
> entry when it is inserted into the List. Looking at the package name for<br>
> this or at this time would be futile.<br>
> -W<br>
><br>
</div><div><div class="h5">> On 9 March 2012 16:44, gboro54 &lt;gboro54@&gt; wrote:<br>
><br>
>> No I am not using CEP and I didn't think STREAM mode made a difference. I<br>
>> am<br>
>> just as perplexed as you on why this is happening. Could it be salience<br>
>> is<br>
>> only respected in the same package(these are in different packages )? I<br>
>> am<br>
>> just taking a stab in the dark at this point. I generated audit logs and<br>
>> it<br>
>> can be seen that the removal rule activation is created first and<br>
>> executed<br>
>> first(it looks like 75% of the time based on my test this occurs)<br>
>><br>
>><br>
>> laune wrote<br>
>> ><br>
>> > It's difficult to imagine that doing the same thing with equal facts in<br>
>> > identically configured sessions would create differing objects. And it<br>
>> > was the intent of my questions to unearth some irregularity, and to<br>
>> > narrow it down.<br>
>> ><br>
>> > STREAM mode shouldn't matter as you aren't using windows, expiry<br>
>> > or other CEP features - or are you?<br>
>> ><br>
>> > -W<br>
>> ><br>
>> ><br>
>> > On 9 March 2012 15:53, gboro54 &lt;gboro54@&gt; wrote:<br>
>> ><br>
>> >> All sessions are against the same kBase. When I say replicate I mean I<br>
>> >> create<br>
>> >> 10000 separate Orders all the same way(same values for all<br>
>> properties).<br>
>> I<br>
>> >> have not tried to insert all into one session and fire but can try if<br>
>> >> this<br>
>> >> really makes a difference(though I am not sure why it should). I will<br>
>> add<br>
>> >> an<br>
>> >> update to 1 as well but again I am not sure why this would matter to a<br>
>> >> low<br>
>> >> ranking rule who does not care about the actual values from that rule<br>
>> >><br>
>> >> --<br>
>> >> View this message in context:<br>
>> >><br>
>> <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>
>> >> Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
>> >> _______________________________________________<br>
>> >> rules-users mailing list<br>
>> >> rules-users@.jboss<br>
>> >> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>> >><br>
>> ><br>
>> > _______________________________________________<br>
>> > rules-users mailing list<br>
>> > rules-users@.jboss<br>
>> > <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>> ><br>
>><br>
>><br>
>> --<br>
>> View this message in context:<br>
>> <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>
>> Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
>> _______________________________________________<br>
>> rules-users mailing list<br>
>> rules-users@.jboss<br>
>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>><br>
><br>
> _______________________________________________<br>
> rules-users mailing list<br>
> rules-users@.jboss<br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
><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>