[rules-users] KnowledgeAgent ChangeSet failing to reload resources

etfink123 fink_eric at bah.com
Thu Nov 4 11:50:20 EDT 2010


Jason,

Your's sound slightly different in that you have not been able to
successfully fire up your KnowledgeBase at all.

Mine works, but fails once an invalid DRL file is read.

In any case, I am not use PKG for my ChangeSet resources:

<change-set xmlns='http://drools.org/drools-5.0/change-set'
    xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
    xs:schemaLocation='http://drools.org/drools-5.0/change-set.xsd' >
    <add>
        <resource source='file:C:/Transformations.drl' type='DRL' />
        <!--resource
source='classpath:bass/enrichment/rules/Transformations.drl' type='DRL' /-->
    </add>
</change-set>

I am creating the KA as follows:

        KnowledgeAgentConfiguration agentConfig =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
        agentConfig.setProperty("drools.agent.newInstance", "false");

        agent = KnowledgeAgentFactory.newKnowledgeAgent("MyAgent",
agentConfig);
        kaListener = new KnowledgeAgentEventListenerImpl();
        agent.addEventListener(kaListener);
       
agent.applyChangeSet(ResourceFactory.newClassPathResource("rules/ChangeSet.xml"));
        agent.monitorResourceChangeEvents(true);

        ResourceChangeScannerConfiguration scannerConfig =
ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
        scannerConfig.setProperty("drools.resource.scanner.interval", "5");

       
ResourceFactory.getResourceChangeScannerService().configure(scannerConfig);
        ResourceFactory.getResourceChangeNotifierService().start();
        ResourceFactory.getResourceChangeScannerService().start();

I'll keep you posted if I hear anything.

- Eric

-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/KnowledgeAgent-ChangeSet-failing-to-reload-resources-tp1842033p1842540.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list