Created
November 4, 2011 17:51
-
-
Save mpellegrini/1339995 to your computer and use it in GitHub Desktop.
Configuring a Drools KnowledgeAgent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KnowledgeAgentConfiguration agentConf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration(); | |
agentConf.setProperty("drools.agent.newInstance", "false"); | |
// scan every second | |
ResourceChangeScannerConfiguration config = ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration(); | |
config.setProperty("drools.resource.scanner.interval", "1"); | |
ResourceFactory.getResourceChangeScannerService().configure(config); | |
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("problem", agentConf); | |
//Resource resource = ResourceFactory.newFileResource("resources/change-se.xml"); | |
Resource resource = ResourceFactory.newClassPathResource("change-set.xml"); | |
kagent.applyChangeSet(resource); | |
KnowledgeBase kbase = kagent.getKnowledgeBase(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment