Thanks Esteban,

1. I will try that.

2. No, I did not use queries. They are just rules that use functions in my fact object.

2010/6/11 Esteban Aliverti <esteban.aliverti@gmail.com>
Hi,

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).

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

Best,


On Thu, Jun 10, 2010 at 9:43 PM, malkhafaji <moe.alkhafaji@medcpu.com> wrote:

Hello,

I have two questions. Hopefully they are very simple:

1. If I wanted to dynamically update a package in the RuleBase because I
found out that the drl was updated on disk, can I just do this:

ruleBase.addPackage(myPackage);

And this will automatically replace (remove the old one, and add the new
one)? Or do I have to implicitly first remove the existing one and THEN add
the modified one again?

I have the following code:

if (ruleBase.getPackage(onePackage.getName()) != null) {
       ruleBase.removePackage(onePackage.getName());
}
ruleBase.addPackage(onePackage);

Is this a code practice to do?

2. My second question is, the statement above in the body of the IF block,
threw the following exception:

Exception in thread "AdminHandler_0_123877285495354"
java.lang.NullPointerException
INFO|7032/0|10-06-10 13:43:55|  at
org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:235)
INFO|7032/0|10-06-10 13:43:55|  at
org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:413)
INFO|7032/0|10-06-10 13:43:55|  at
org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:729)
INFO|7032/0|10-06-10 13:43:55|  at
org.drools.common.AbstractRuleBase.removePackage(AbstractRuleBase.java:657)
INFO|7032/0|10-06-10 13:43:55|  at [statement in the IF block above]

Any ideas why that is?

Thanks.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/RuleBase-Question-tp887326p887326.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
Moe Alkhafaji
Chief Technology Officer, MedCPU
Phone: (630) 290-1113
Email: cto@medcpu.com

This message contains information which may be confidential. Unless you are the addressee, you may not use, copy or disclose to anyone the message or any information contained in this message. If you have received this email in error, please notify cto@medcpu.com and please delete the message immediately. In order for the contents of this message to be binding on behalf of MedCPU it must be confirmed in writing by an authorized signatory of MedCPU. Our company accepts no liability for the content of this email unless it is so confirmed. The views or opinions presented herein do not necessarily represent those of the company.