Re: [rules-users] Manage dynamically rules in KnowledgeBase

2013-07-24 Thread tiahdomoina
Thank you Mark :)



--
View this message in context: 
http://drools.46999.n3.nabble.com/Manage-dynamically-rules-in-KnowledgeBase-tp4025108p4025120.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Manage dynamically rules in KnowledgeBase

2013-07-24 Thread tiahdomoina
Thanks for the link, it definitely helped me 

I was wondering about 2 things :

1- With the knowledgeBuilder, you can check if there is an error with the
method getErrors(). So you can remove immediately the resource which caused
the error. Is there anything like that for the KnowledgeBase to check after
adding a new KnowledgePackage in it ?

2- If I want to remove a rule, I have to update all facts. But for my
application, I have 20 000 facts, is there any specific way to manage it ?



--
View this message in context: 
http://drools.46999.n3.nabble.com/Manage-dynamically-rules-in-KnowledgeBase-tp4025108p4025114.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Manage dynamically rules in KnowledgeBase

2013-07-24 Thread tiahdomoina
Thanks :) I will take a look at it now !



--
View this message in context: 
http://drools.46999.n3.nabble.com/Manage-dynamically-rules-in-KnowledgeBase-tp4025108p4025111.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Manage dynamically rules in KnowledgeBase

2013-07-23 Thread tiahdomoina
Hello :)

How can I manage dynamically rules in KnowledgeBase ? I mean remove, add or
update rules without rebuilding a new KnowledgeBase or a new
KnowledgeSession. Is it possible ?

I tried with a basic example:

KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("rule.DRL"),
ResourceType.DRL);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
// insertion of facts
ksession.fireAllRules();
kbase.removeRule("package", "myRule");  
ksession.fireAllRules();

But the rules don't seem to be fired the second time. I also tried to create
a new session but the result is the same.

I don't wanna use a KnowledgeAgent because the modification of the rules is
not very frequent.
But when there is one, it has to be applied immediately and shouldn't wait
for the interval of time of the scan.

If anyone has an idea :)

Thank you !



--
View this message in context: 
http://drools.46999.n3.nabble.com/Manage-dynamically-rules-in-KnowledgeBase-tp4025108.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users