[rules-users] Facing problem in ResourceChangeScanner

Saurabh maheshwari.saurabh03 at gmail.com
Fri Mar 23 02:51:41 EDT 2012


Hi ,

I am trying to understand KnowledgeAgent functioality.
 but i am facing following issue

 ResourceChangeScanner  is scanning the change resource and building the
Knowledgebase but still firing previous rules.

I am using these line of codes

                File fxml = new File("change-set.xml");
		kbase = KnowledgeBaseFactory.newKnowledgeBase();
                ResourceChangeScannerConfiguration sconf =
ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
		sconf.setProperty("drools.resource.scanner.interval", "2");
		ResourceFactory.getResourceChangeScannerService().configure(sconf);

		KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
		aconf.setProperty("drools.agent.scanDirectories", "true");
               
aconf.setProperty("drools.agent.useKBaseClassLoaderForCompiling", "true"); 
		aconf.setProperty("drools.agent.scanResources", "true");
		aconf.setProperty("drools.agent.newInstance", "true");
		KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("test
agent", kbase, aconf);
                System.out.println("test agent:" + kagent.getName());
               
kagent.applyChangeSet(ResourceFactory.newUrlResource(fxml.toURI().toURL()));
                ksession =
kagent.getKnowledgeBase().newStatefulKnowledgeSession();


Thanks ,
Saurabh

--
View this message in context: http://drools.46999.n3.nabble.com/Facing-problem-in-ResourceChangeScanner-tp3850837p3850837.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list