Your description seems somewhat incomplete.<br><br><div class="gmail_quote">On 18 October 2011 21:53, rajee.sakthi <span dir="ltr">&lt;<a href="mailto:rajee.sakthivadivelu@rph.com">rajee.sakthivadivelu@rph.com</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;">Hi,<br>
<br>
I am a newbie to DROOLs. I want to cross check with you for any potential<br>
issues that you see about my DROOLs usage.<br>
I have a requirement to create multiple DRLs that use the same namespace.<br>
Hence, I am adding rules from DRL1, DRL2, DRL3 to a package named<br>
&quot;com.myproj.pkg&quot;.<br>
And at some point I am removing rules of DRL1 from the knowledge package<br>
leaving rest of the rules.<br></blockquote><div>So the rules from DRL2 and DRL3 remain in the package.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br>
When all the rules from the package are removed, then I am removing the<br>
knowledge package.<br></blockquote><div>Which, according my previous statment (which reflects your description), will never happen.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br>
This is all done with StatefulSession.<br>
<br>
So my rules removal code looks like this:<br>
<br>
String pkgName = kpkg.getName();<br>
Collection&lt;Rule&gt; rules = kpkg.getRules();<br>
<br>
for(Rule rule : rules) {<br>
            knowledgeBase.removeRule(pkgName, rule.getName());<br>
}<br>
<br>
KnowledgePackage pkgAfterRemove =<br>
knowledgeBase.getKnowledgePackage(pkgName);<br>
Collection&lt;Rule&gt; rulesAfterCleanup = pkgAfterRemove.getRules()<br>
if(rulesAfterCleanup == null || rulesAfterCleanup.isEmpty()) {<br>
        knowledgeBase.removeKnowledgePackage(pkgName);<br>
}<br>
<br>
I tested this logic and it works fine but does anyone see any side effects<br>
of such logic?<br></blockquote><div><br>A knowledge base is just a bunch of data with rules, functions, etc. There&#39;s not much point in removing the package after all the rules are gone, so why bother?<br><br>And one wonders: is the remaining knowledge base still good for creating sessions?<br>
 <br>-W<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
I did a short search in the forum and couldnt find any similar posts.<br>
<br>
Thanks a bunch,<br>
Rajee<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Rules-from-Multiple-DRLs-use-the-same-namespace-tp3432304p3432304.html" target="_blank">http://drools.46999.n3.nabble.com/Rules-from-Multiple-DRLs-use-the-same-namespace-tp3432304p3432304.html</a><br>

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>
</font></blockquote></div><br>