<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 13 Dec 2013, at 13:51, lbilger &lt;<a href="mailto:lars.bilger@lhsystems.com">lars.bilger@lhsystems.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I thought that was what the KieScanner did? </blockquote>KieScanner re-resolves the pom and it’s dependencies, and checks against what is currently deployed. If any of the versions have changed, it updates the current KieContainer.</div><div><br></div><div><br><blockquote type="cite">I spent some time trying to get<br>it to work as I would expect it to, but ran into several problems that made<br>me go back to 5.5 for now.<br><br>Here's what I did:<br>I created two maven projects, one to contain the rules ("drools6:rules") and<br>one to use them ("drools6:drools6").<br>In "drools6:drools6" I created a Main class and method in which I initialize<br>the KieContainer and KieScanner as follows:<br><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;KieServices kieServices = KieServices.Factory.get();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ReleaseId releaseId = kieServices.newReleaseId("drools6", "rules",<br>"1.0.0-SNAPSHOT");<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;final KieContainer kieContainer =<br>kieServices.newKieContainer(releaseId);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;KieScanner kieScanner = kieServices.newKieScanner(kieContainer);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kieScanner.start(1000);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Some code to see when rules were changed<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.in.read(); // Keep the VM running while waiting for rule<br>changes<br><br>Now I would expect the rules to be automatically picked up if I change them<br>in "drools6:rules" and "mvn install" it. But no changes are detected.</blockquote>There is a limitation in 6.0.0 - fixed in master. Once you pass in the initial root releaseId - it resolves it to real version, and uses that for all scanNows. So only dependencies in the pom.xml will have their -SNAPSHOT re-resolved. The work around was to create a wrapper project.</div><div><br></div><div>A previous email "Re: [rules-users] Drools 6 and dynamic update”:</div><div>"On a side note, on master, there is a change to ensure that the Maven syntax for scanNow (with using the KieScanner) is obeyed. see</div><a href="https://issues.jboss.org/browse/DROOLS-356">https://issues.jboss.org/browse/DROOLS-356</a>"<div><br></div><div><br><blockquote type="cite"> I<br>debugged the KieScanner and it seems that it compares the version number of<br>the releaseId to the one from the repository, which is "1.0.0-SNAPSHOT" in<br>both cases, so the new jar is not considered newer.<br><br>So I thought, "OK, so I need to change the version number". I changed the<br>version of the "drools6:rules" project to 1.0.1-SNAPSHOT. This didn't help<br>either, because the releaseId explicitly requests 1.0.0-SNAPSHOT, so the<br>newer version is never loaded.<br><br>My next idea was to use "LATEST" in the releaseId instead of an explicit<br>version. At first this did not work for my local repository, but after<br>manually editing the maven metadata file and adding a &lt;latest&gt; tag, it found<br>the new version. But now, the KieScanner found a change every time it looked<br>because it compared the version string "LATEST" to "1.0.1-SNAPSHOT" and<br>always considered the "real" version newer. With a certain amount of rules<br>and a short polling interval this caused the KieContainer to be busy<br>rebuilding all the time and a very high CPU load.<br><br>I also tried deploying to a real maven repository instead of just installing<br>to local, but with no success.<br><br><br>What am I missing here? Or isn't this how the KieScanner is supposed to<br>work?<br></blockquote><div>Try the latest snapshot, that has the above issue, in 356, &nbsp;fixed.</div><a href="http://downloads.jboss.org/drools/release/snapshot/6.0.x/">http://downloads.jboss.org/drools/release/snapshot/6.0.x/</a><br><blockquote type="cite"><br>Thanks<br>Lars<br><br><br>Mark Proctor wrote<br><blockquote type="cite">We do not have any file change listeners. You, or the workbench, needs to<br>build the jar.<br><br>What is automatic is the role of change sets before. You no longer need to<br>compute them, build the jar, have the client consume the jar &nbsp;(with<br>different ReleaseID) - that’s it. Drools diffs the current and target jar,<br>and upgrades accordingly.<br><br>Mark<br></blockquote><br><br><br><br><br>--<br>View this message in context: http://drools.46999.n3.nabble.com/Drools-6-support-for-changeset-tp4027138p4027279.html<br>Sent from the Drools: User forum mailing list archive at Nabble.com.<br><br>_______________________________________________<br>rules-users mailing list<br>rules-users@lists.jboss.org<br>https://lists.jboss.org/mailman/listinfo/rules-users</blockquote></div><br></body></html>