[rules-users] Existing StateFulKnowledgeSession not taking the changes in the Guvnor

sumatheja sumatheja at gmail.com
Tue May 1 13:35:02 EDT 2012


Hi All,
        I have a problem refreshing the sateful knowledge session whenever
there is a change in the rules assets int he guvnor. Below is my code used
for configuration


            StatefulKnowledgeSession ksession = null;
            KnowledgeAgentConfiguration kconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
            KnowledgeBaseConfiguration config =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
            config.setOption( EventProcessingOption.STREAM );
            KnowledgeBase  kbase = KnowledgeBaseFactory.newKnowledgeBase(
config );
            kconf.setProperty("drools.agent.newInstance" , "false");
            KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent("MyAgent1",kbase, kconf);
            kagent.applyChangeSet(ResourceFactory.newUrlResource("
http://127.0.0.1:8380/drools-guvnor/LDIChangeSet.xml"));

            kbase = kagent.getKnowledgeBase();
            ksession = kbase.newStatefulKnowledgeSession();


I've a session where I've inserted thousands of facts. Whenever there is
change in the rule base Do I need to reinsert all the facts using the new
knowledgeBase? Any help would be appreciated. Thanks in advance.


-- 
cheers
Sumatheja Dasararaju
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120501/8f6220e3/attachment.html 


More information about the rules-users mailing list