[rules-users] KnowledgeAgent detects resource changes and updates but nothing changes

Tina Vießmann tviessmann at stud.hs-bremen.de
Wed Aug 18 10:31:39 EDT 2010


  Hi,

I've set up a knowledge agent the change set configuration. While 
running the application I'm changing the rules file and the agent 
detects the change and rebuidls the knowledge base. But after that the 
output that should have changed didn't change.

Thank you! :)

Greetings
Tina


Here are the code snippets:

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

    KnowledgeAgent kagent =
    KnowledgeAgentFactory.newKnowledgeAgent("AITS CEP Engine Agent");
    kagent.applyChangeSet(ResourceFactory.newClassPathResource("changeset.xml"));

    KnowledgeBase knowledgeBase = kagent.getKnowledgeBase();

    session = knowledgeBase.newStatefulKnowledgeSession();



    <change-set xmlns='http://drools.org/drools-5.0/change-set'
                 xmlns:xs='http://www.w3.org/2001/XMSchema-instance'
                
    xs:schmeaLocation='http://drools.org/drools-5.0/change-setdrools-change-set-5.0.xsd'
     >

    <add>
    <resource source='classpath:testRule.drl' type='DRL' />
    </add>

    </change-set>



The status information put out to the console are:

[2010:08:230 16:08:93:debug] ResourceChangeScanner attempt to scan 1 
resources
[2010:08:230 16:08:93:debug] ResourceChangeScanner modified 
resource=[ClassPathResource path='testRule.drl'] : 1282139449234 : 
1282141364812
[2010:08:230 16:08:93:debug] ResourceChangeNotification received 
ChangeSet notification
[2010:08:230 16:08:93:debug] ResourceChangeScanner thread is waiting for 
60 seconds.
[2010:08:230 16:08:93:debug] ResourceChangeNotification processing ChangeSet
[2010:08:230 16:08:93:debug] ResourceChangeNotification ChangeSet 
modified resource=[ClassPathResource path='testRule.drl'] for 
listener=org.drools.agent.impl.KnowledgeAgentImpl at 1acfa31
[2010:08:230 16:08:93:debug] KnowledgeAgent received ChangeSet changed 
notification
[2010:08:230 16:08:93:info] KnowledgeAgent applying ChangeSet
[2010:08:230 16:08:93:debug] KnowledgeAgent rebuilding KnowledgeBase 
using ChangeSet
[2010:08:230 16:08:109:debug] ResourceChangeNotification thread is 
waiting for queue update
[2010:08:230 16:08:218:debug] KnowledgeAgent obtaining pkg 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] KnowledgeAgent mapping 
resource=[ClassPathResource path='testRule.drl'] to 
KnowledgeDefinition=[Rule name=Insert Watcher Into Knowledge Base, 
agendaGroup=MAIN, salience=0, no-loop=false]
[2010:08:230 16:08:218:debug] KnowledgeAgent notifier subscribing to 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] ResourceChangeNotification subscribing 
listener=org.drools.agent.impl.KnowledgeAgentImpl at 1acfa31 to 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] KnowledgeAgent mapping 
resource=[ClassPathResource path='testRule.drl'] to 
KnowledgeDefinition=[Rule name=Add Event to Watcher Set, 
agendaGroup=MAIN, salience=0, no-loop=false]
[2010:08:230 16:08:218:debug] KnowledgeAgent notifier subscribing to 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] ResourceChangeNotification subscribing 
listener=org.drools.agent.impl.KnowledgeAgentImpl at 1acfa31 to 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] KnowledgeAgent mapping 
resource=[ClassPathResource path='testRule.drl'] to 
KnowledgeDefinition=org.drools.rule.TypeDeclaration at 1bed3d1
[2010:08:230 16:08:218:debug] KnowledgeAgent notifier subscribing to 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] ResourceChangeNotification subscribing 
listener=org.drools.agent.impl.KnowledgeAgentImpl at 1acfa31 to 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] KnowledgeAgent mapping 
resource=[ClassPathResource path='testRule.drl'] to 
KnowledgeDefinition=org.drools.rule.TypeDeclaration at 1f528ab
[2010:08:230 16:08:218:debug] KnowledgeAgent notifier subscribing to 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] ResourceChangeNotification subscribing 
listener=org.drools.agent.impl.KnowledgeAgentImpl at 1acfa31 to 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] KnowledgeAgent mapping 
resource=[ClassPathResource path='testRule.drl'] to 
KnowledgeDefinition=org.drools.rule.Function at 1bb9829
[2010:08:230 16:08:234:debug] KnowledgeAgent notifier subscribing to 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] ResourceChangeNotification subscribing 
listener=org.drools.agent.impl.KnowledgeAgentImpl at 1acfa31 to 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] KnowledgeAgent mapping 
resource=[ClassPathResource path='testRule.drl'] to 
KnowledgeDefinition=org.drools.rule.Function at eb840f
[2010:08:230 16:08:234:debug] KnowledgeAgent notifier subscribing to 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] ResourceChangeNotification subscribing 
listener=org.drools.agent.impl.KnowledgeAgentImpl at 1acfa31 to 
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] KnowledgeAgent adding 
KnowledgeDefinitionsPackage net.eads.astrium.aits.cep.rules
[2010:08:230 16:08:250:info] KnowledgeAgent new KnowledgeBase now built 
and in use
[2010:08:230 16:08:250:debug] KnowledgeAgent finished rebuilding 
KnowledgeBase using ChangeSet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100818/abde2c26/attachment.html 


More information about the rules-users mailing list