I have created the following issue to keep track of this problem: <a href="https://issues.jboss.org/browse/JBRULES-2940">https://issues.jboss.org/browse/JBRULES-2940</a><div><br></div><div>I have also made some fixes, so It would be great if you could test them.</div>

<div><br></div><div>Best Regards,</div><div><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>


<br><br><div class="gmail_quote">On Tue, Mar 22, 2011 at 2:44 AM, Steven Williams <span dir="ltr">&lt;<a href="mailto:stevearoonie@gmail.com">stevearoonie@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;">

I&#39;m not sure whether they were added or not. I noticed the rules weren&#39;t running when I expected them to though, so perhaps not. I have worked around it by putting all my rules in the same package - luckily I only had about 30 different rule files, but it is a less than ideal solution.<div>


<br></div><div>Once I have everything working and checked in on my project I&#39;ll test further to see what is going on.</div><div><br></div><div>Steve<div><div></div><div class="h5"><div><br><div class="gmail_quote">On Tue, Mar 22, 2011 at 2:43 PM, Esteban Aliverti <span dir="ltr">&lt;<a href="mailto:esteban.aliverti@gmail.com" target="_blank">esteban.aliverti@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">Someone mentioned me the problem some time ago. I have a fix for it in my local repo, butI was waiting for the trunk to be stable to test it. <div>


The problem is that under certain circumstances, the kagent is reusing the same kbuilder to compile all the resources present in a change-set (the modifications I have force the agent to use a new kbuilder for each resource). </div>




<div>The only difference between what you are reporting and the problem I&#39;m talking about is that in my case all the rules, functions, etc were added to the kbase, but all within the same package. No matter the real package definition. Is this your case also?</div>




<div><br></div><div>Please file a bug report and let me know.</div><div><br></div><div>Best Regards,<br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>




- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
<br><br><div class="gmail_quote"><div><div></div><div>2011/3/21 Steven Williams <span dir="ltr">&lt;<a href="mailto:stevearoonie@gmail.com" target="_blank">stevearoonie@gmail.com</a>&gt;</span><br></div></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>

<span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"><div>Hi all,</div><div><br></div>I am trying to use a Knowledge Agent in 5.1.1 with a change set with a few different packages and resource types in it, and I am running into a problem where it is not adding all the packages. Looking at the code I can see that KnowledegeAgentImpl.createPackageFromResource has the following code when it loads a resource:<div>





<br></div><div><p>            <span>if</span> (kbuilder.getKnowledgePackages().iterator().hasNext()) {</p><p>                <span>return</span> (KnowledgePackageImp) kbuilder.getKnowledgePackages().iterator().next();</p>





<p>            }</p><p><br></p><p><span style="font-family:arial;font-size:small">and KnowledgeBuilderImpl.getKnowledgePackages does the following:</span></p><p><span style="font-family:arial;font-size:small"><br>
</span></p><p><span></span><span></span>Package[] pkgs = pkgBuilder.getPackages();</p><p><span style="font-family:arial;font-size:small"><span style="font-family:Monaco;font-size:11px"><span></span><span></span>List&lt;KnowledgePackage&gt; list = <span>new</span> ArrayList&lt;KnowledgePackage&gt;( pkgs.length );</span> </span></p>





<p></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-family:arial;font-size:small"><span style="font-family:arial;font-size:small"><br></span></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">





<font face="arial" size="2">and PackageBuilder.getPackages does the following:</font></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="arial" size="2"><br></font></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">





<font face="arial" size="2"></font></p><p><font face="arial" size="2">        <span>for</span> ( PackageRegistry pkgRegistry : <span>this</span>.<span>pkgRegistryMap</span>.values() ) {</font></p><font face="arial" size="2"><p>





            Package pkg = pkgRegistry.getPackage();</p><p>            // add package to array</p><p>        }</p></font><p></p><div style="font-family:arial;font-size:small"><br></div><div style="font-family:arial;font-size:small">





pkgRegistryMap is implemented as a HashMap however so the order the packages are returned in is not guaranteed. I seem to be hitting this problem. </div><div style="font-family:arial;font-size:small"><br></div><div style="font-family:arial;font-size:small">





This is a hard one to create a unit test for so I wanted to check that my analysis is correct before raising a bug. Perhaps using a LinkedHashMap or similar would fix it?</div><div style="font-family:arial;font-size:small">





<br></div><div style="font-family:arial;font-size:small">thanks</div><div style="font-family:arial;font-size:small">Steve</div></div></span>
<br></div></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>