@Wolfgang, maybe I need to update the documentation to explicitly inform about this behavior :). The agent doesn't make anything special to sync the sessions with the kbase. If you add a rule by hand to an existing kbase, all the session from this kbase will automatically detect the changes. <div>
Now I'm working in a helper class to create and apply change-set in a programatic way. So if you don't want kbases to be automatically modified when a resource chages, you can use this helper class.</div><div><br>
</div><div>Best Regards, <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">2011/4/20 Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">2011/4/20 Esteban Aliverti <span dir="ltr"><<a href="mailto:esteban.aliverti@gmail.com" target="_blank">esteban.aliverti@gmail.com</a>></span><br></div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
@Wolfgang: if you are using <span style="border-collapse:collapse;color:rgb(0, 0, 255);font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:11px;line-height:14px">drools.agent.newInstance=true </span>(the default configuration), then whenever a change-set is applied, either because you explicitly force the agent to do so, or because a monitored resource changes, the kbase inside the agent is thrown away an a new kbase is created. So you need to get the kbase from the agent and retrieve a fresh session from it.<div>
You can confirm this behavior in this set of tests: <span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><a href="https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentIncrementalChangeSetTest.java" style="color:rgb(7, 77, 143)" target="_blank">https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentIncrementalChangeSetTest.java</a> <br>
</span><div>But, if you are using <span style="border-collapse:collapse;color:rgb(0, 0, 255);font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:11px;line-height:14px">drools.agent.newInstance=false </span>the internal kbase (and each stateful session you got from it) is refreshed when a change-set is applied.<br>
<br></div></div></blockquote></div><div><br>Would you please point me to the doc where it says "and each stateful session ... is refreshed"?<br><br>If true, this were an extremely risky operation. Consider a stateful session whizzing along and - smack! - rules change right in the middle of a sequence of firings. Shudder.<br>
<br>-W<br><br><br></div></div><br>
<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>