[rules-users] KnowledgeAgent ChangeSet failing to reload resources

Jason Davidson jljdavidson at gmail.com
Wed Nov 10 10:56:49 EST 2010


Eric,

Thanks for your help.  I was never able to get the Drools Spring Resource
Scanner to work.  Instead I changed my Spring beans to use a KnowledgeAgent
similar to the code you've outlined below and it's working.

Jason

On Thu, Nov 4, 2010 at 9:50 AM, etfink123 <fink_eric at bah.com> wrote:

>
> 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.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20101110/4a91d224/attachment.html 


More information about the rules-users mailing list