[rules-users] Dynamically loading rules in KieBase

marianbuenosayres marianbuenosayres at gmail.com
Tue Jul 22 10:20:08 EDT 2014


I'm bumping this question for general interest on other possible solutions,
and to give my two cents. 

The closest I was to getting this feature in Drools 6 from the public APIs,
is to use a persistent session. Then, when I loaded an existing session, I
would pass a newly created KieBase, like this

KieStoreServices kstore = KieServices.Factory.get().getStoreServices();

KieBase kbase = ...; //create a Kie Base
Environment env = ...; //create an environment
KieSession ksession = kstore.newKieSession(kbase, null, env);
Integer sessionId = ksession.getId();

KieBase kbase2 = ...; //updated Kie base
KieSession ksessionReloaded = ks.loadKieSession(kbase2, null, env);

ksession and ksessionReloaded would be the same working memory and agenda,
but the kie base they work with would change. 

Hope this helps, but I hope more for an alternative



--
View this message in context: http://drools.46999.n3.nabble.com/Dynamically-loading-rules-in-KieBase-tp4030351p4030425.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list