When working on incremental change-set processing mode, Knowledge Agent performs a diff between the original and the modified <meta http-equiv="content-type" content="text/html; charset=utf-8">resources. Modified resources are compiled, and a visitor pattern is used to loop over knowledge definitions (such as rules, functions, queries, etc.).<div>
So if rule1 was modified in the new resource, it is removed from the original kbase and replaced with the new implementation. The thing is that kagent doesn't implement a visitor for TypeDeclaration (when you use <b>declare</b> in your DRL to define your model) so it doesn't know how to handle them. </div>
<div>I have recently fix a typo in the visitor implementation that prevented you to receive a better message:</div><div><br></div><div>"BinaryResourceDiffProducerImpl: Couldn't handle "+yourDefinitionName+". We must leave it in the new Package."</div>
<div><br></div><div>This means that kagent doesn't support modifications on declared types yet.</div><div><br></div><div>Best,</div><div><br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>
- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
<br><br><div class="gmail_quote">2010/8/23 Tina Vießmann <span dir="ltr"><<a href="mailto:tviessmann@stud.hs-bremen.de">tviessmann@stud.hs-bremen.de</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I'm getting a two red highlighted outputs in eclipse if I modify my
rules file during run time. Besides that the modifications seem to
work.<br>
What does it mean?<br>
<br>
The full output I get when the resource change is detected is listed
below. The bold lines are the concerned ones.<br>
<br>
Thanks for any help! :)<br>
Tina<br>
<br>
<br>
[2010:08:235 21:08:296:debug] ResourceChangeScanner attempt to scan
1 resources<br>
[2010:08:235 21:08:296:debug] ResourceChangeScanner modified
resource=[ClassPathResource path='testRule.drl'] : 1282559206875 :
1282591705000<br>
[2010:08:235 21:08:296:debug] ResourceChangeNotification received
ChangeSet notification<br>
[2010:08:235 21:08:296:debug] ResourceChangeScanner thread is
waiting for 10 seconds.<br>
[2010:08:235 21:08:296:debug] ResourceChangeNotification processing
ChangeSet<br>
[2010:08:235 21:08:296:debug] ResourceChangeNotification ChangeSet
modified resource=[ClassPathResource path='testRule.drl'] for
listener=org.drools.agent.impl.KnowledgeAgentImpl@b40ec4<br>
[2010:08:235 21:08:296:debug] KnowledgeAgent received ChangeSet
changed notification<br>
[2010:08:235 21:08:296:info] KnowledgeAgent applying ChangeSet<br>
[2010:08:235 21:08:296:debug] KnowledgeAgent removing mappings for
resource=[ClassPathResource path='testRule.drl'] with
unsubscribe=true<br>
[2010:08:235 21:08:296:debug] KnowledgeAgent notifier unsubscribing
to resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:296:debug] ResourceChangeNotification
unsubscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@b40ec4 to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:296:debug] ResourceChangeScanner unsubcribing
notifier=org.drools.io.impl.ResourceChangeNotifierImpl@13576a2 to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:296:debug] ResourceChangeScanner
resource=[ClassPathResource path='testRule.drl'] now has no
subscribers<br>
[2010:08:235 21:08:296:debug] KnowledgeAgent rebuilding
KnowledgeBase using ChangeSet<br>
[2010:08:235 21:08:296:info] KnowledgeAgent performing an
incremental build of the ChangeSet<br>
[2010:08:235 21:08:296:debug] ResourceChangeNotification thread is
waiting for queue update<br>
[INFO ] 21:30:10,375 [main] "Event retracted." (DRL Logger)<br>
[2010:08:235 21:08:453:debug] KnowledgeAgent: Diffing:
[ClassPathResource path='testRule.drl']<br>
[INFO ] 21:30:10,453 [main] "Event retracted." (DRL Logger)<br>
[2010:08:235 21:08:500:debug] BinaryResourceDiffProducerImpl: [Rule
name=delete parameter values, agendaGroup=MAIN, salience=0,
no-loop=false] is not present anymore. Adding to removed list.<br>
[2010:08:235 21:08:500:debug] BinaryResourceDiffProducerImpl:
org.drools.rule.Function@67fe80 did change. Marking as removed so it
new version could be added later.<br>
[2010:08:235 21:08:500:debug] BinaryResourceDiffProducerImpl:
Comparing [Rule name=Warning threshold exceeded to many times,
agendaGroup=MAIN, salience=0, no-loop=false] against [Rule
name=Warning threshold exceeded to many times, agendaGroup=MAIN,
salience=0, no-loop=false]<br>
<b>no visitor implementation for : class
org.drools.rule.TypeDeclaration :
org.drools.rule.TypeDeclaration@95f290<br>
no visitor implementation for : class
org.drools.rule.TypeDeclaration :
org.drools.rule.TypeDeclaration@bfd66a</b><br>
[2010:08:235 21:08:546:debug] BinaryResourceDiffProducerImpl: [Rule
name=Warning threshold exceeded to many times, agendaGroup=MAIN,
salience=0, no-loop=false] didn't change. Removing from diff package
and adding it to unmodified list.<br>
[2010:08:235 21:08:546:debug] BinaryResourceDiffProducerImpl:
Comparing [Rule name=Insert Watcher Into Knowledge Base,
agendaGroup=MAIN, salience=0, no-loop=false] against [Rule
name=Insert Watcher Into Knowledge Base, agendaGroup=MAIN,
salience=0, no-loop=false]<br>
[2010:08:235 21:08:546:debug] BinaryResourceDiffProducerImpl: The
rules have different LHS<br>
[2010:08:235 21:08:546:debug] BinaryResourceDiffProducerImpl:
Comparing [Rule name=Add Event to Watcher Set, agendaGroup=MAIN,
salience=0, no-loop=false] against [Rule name=Add Event to Watcher
Set, agendaGroup=MAIN, salience=0, no-loop=false]<br>
[2010:08:235 21:08:546:debug] BinaryResourceDiffProducerImpl: The
rules have different LHS<br>
[2010:08:235 21:08:546:debug] KnowledgeAgent: Removing: [Rule
name=delete parameter values, agendaGroup=MAIN, salience=0,
no-loop=false]<br>
[2010:08:235 21:08:546:debug] KnowledgeAgent removing Rule=[Rule
name=delete parameter values, agendaGroup=MAIN, salience=0,
no-loop=false] from package=net.eads.astrium.aits.cep.rules<br>
[2010:08:235 21:08:546:debug] KnowledgeAgent: Removing:
org.drools.rule.Function@67fe80<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=[Rule name=Warning threshold exceeded to many
times, agendaGroup=MAIN, salience=0, no-loop=false]<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent obtaining pkg
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=[Rule name=Insert Watcher Into Knowledge Base,
agendaGroup=MAIN, salience=0, no-loop=false]<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:562:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@b40ec4 to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:562:debug] ResourceChangeScanner subcribing
notifier=org.drools.io.impl.ResourceChangeNotifierImpl@13576a2 to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=[Rule name=Add Event to Watcher Set,
agendaGroup=MAIN, salience=0, no-loop=false]<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:562:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@b40ec4 to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=org.drools.rule.TypeDeclaration@17dff15<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:562:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@b40ec4 to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=org.drools.rule.TypeDeclaration@f5cbda<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:562:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@b40ec4 to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=org.drools.rule.Function@11a59ce<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:562:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@b40ec4 to
resource=[ClassPathResource path='testRule.drl']<br>
[2010:08:235 21:08:562:debug] KnowledgeAgent adding
KnowledgeDefinitionsPackage net.eads.astrium.aits.cep.rules<br>
[2010:08:235 21:08:578:info] KnowledgeAgent incremental build of
KnowledgeBase finished and in use<br>
[2010:08:235 21:08:578:debug] KnowledgeAgent finished rebuilding
KnowledgeBase using ChangeSet
</div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div>