Hi,<div><br></div><div>1. If you want to dynamically update your kbase whenever your resources (DRL, PKG, etc) change, you could use Knowledge Agent. Take a look at the documentation. The KAgent basically makes what you are trying to do. On thing you must to take care (whether you are using KAgent or not) is that whenever you modify a kbase you must rebuild all your sessions (unless they were stateless, of course).</div>

<div><br></div><div>2. Does the package you are trying to remove contains queries definitions? I filled a jira issue some time ago (<a href="https://jira.jboss.org/browse/JBRULES-2374">https://jira.jboss.org/browse/JBRULES-2374</a>) reporting this problem.</div>

<div><br></div><div>Best,<br><br><div class="gmail_quote">On Thu, Jun 10, 2010 at 9:43 PM, malkhafaji <span dir="ltr">&lt;<a href="mailto:moe.alkhafaji@medcpu.com">moe.alkhafaji@medcpu.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
Hello,<br>
<br>
I have two questions. Hopefully they are very simple:<br>
<br>
1. If I wanted to dynamically update a package in the RuleBase because I<br>
found out that the drl was updated on disk, can I just do this:<br>
<br>
ruleBase.addPackage(myPackage);<br>
<br>
And this will automatically replace (remove the old one, and add the new<br>
one)? Or do I have to implicitly first remove the existing one and THEN add<br>
the modified one again?<br>
<br>
I have the following code:<br>
<br>
if (ruleBase.getPackage(onePackage.getName()) != null) {<br>
        ruleBase.removePackage(onePackage.getName());<br>
}<br>
ruleBase.addPackage(onePackage);<br>
<br>
Is this a code practice to do?<br>
<br>
2. My second question is, the statement above in the body of the IF block,<br>
threw the following exception:<br>
<br>
Exception in thread &quot;AdminHandler_0_123877285495354&quot;<br>
java.lang.NullPointerException<br>
INFO|7032/0|10-06-10 13:43:55|  at<br>
org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:235)<br>
INFO|7032/0|10-06-10 13:43:55|  at<br>
org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:413)<br>
INFO|7032/0|10-06-10 13:43:55|  at<br>
org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:729)<br>
INFO|7032/0|10-06-10 13:43:55|  at<br>
org.drools.common.AbstractRuleBase.removePackage(AbstractRuleBase.java:657)<br>
INFO|7032/0|10-06-10 13:43:55|  at [statement in the IF block above]<br>
<br>
Any ideas why that is?<br>
<br>
Thanks.<br>
<font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/RuleBase-Question-tp887326p887326.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/RuleBase-Question-tp887326p887326.html</a><br>


Sent from the Drools - User 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><br clear="all"><br>-- <br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>
</div>