Could you append the log output of the Knowledge Agent?<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">On Wed, Apr 4, 2012 at 4:12 PM, albertorugnone <span dir="ltr"><<a href="mailto:arugnonechemical@gmail.com">arugnonechemical@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thank you every body for your answer, unfortunately I was't able to reply to<br>
you until now because other stuff overwhelmed me literally at work.<br>
Anyway I was going ahead using KnowledgeAgent, following your comments and<br>
other suggestion. Now I am able to load rules applying change set with<br>
KnowledgeAgent (thank you!!!), but honestly this is a poor success because,<br>
even if when I change the rule KnowledgeAgent says "incremental build of<br>
KnowledgeBase finished and in use" nothing changes.<br>
It seems that changes at rules have no effect and it is pretty weird. I made<br>
a maven project with eclipse to explain you better my problem. Is a simple<br>
main. I am working for a better junit test. Anyway if you change the rule in<br>
the folder knowledge you can test the problem by yourself.<br>
Briefly I will explain the project:<br>
<br>
Here the code:<br>
<br>
_l.warn("START");<br>
<div class="im"> String xml = "";<br>
xml += "<change-set xmlns='<a href="http://drools.org/drools-5.0/change-set'&quot" target="_blank">http://drools.org/drools-5.0/change-set'&quot</a>;;<br>
xml += &quot;<br>
xmlns:xs='<a href="http://www.w3.org/2001/XMLSchema-instance'&quot" target="_blank">http://www.w3.org/2001/XMLSchema-instance'&quot</a>;;<br>
xml += &quot;<br>
xs:schemaLocation='<a href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a><br>
drools-change-set-5.0.xsd' >";<br>
xml += " <add> ";<br>
</div> xml += " <resource source='Z:/EXP/drools-test/knowledge/test.drl'<br>
<div class="im">type='DRL' />";<br>
xml += " </add> ";<br>
xml += "</change-set>";<br>
FileManager fileManager = new FileManager();<br>
File fxml = fileManager.newFile("changeset.xml");<br>
</div><div class="im"> Writer output = new BufferedWriter(new FileWriter(fxml));<br>
output.write(xml);<br>
output.close();<br>
</div> // build a KnowledgeAgent<br>
<div class="im"> ResourceFactory.getResourceChangeNotifierService()<br>
.start();<br>
ResourceFactory.getResourceChangeScannerService()<br>
.start();<br>
<br>
final ResourceChangeScannerConfiguration sconf =<br>
ResourceFactory.getResourceChangeScannerService()<br>
.newResourceChangeScannerConfiguration();<br>
sconf.setProperty("drools.resource.scanner.interval", "2");<br>
ResourceFactory.getResourceChangeScannerService()<br>
.configure(sconf);<br>
<br>
final KnowledgeAgentConfiguration aconf =<br>
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();<br>
aconf.setProperty("drools.agent.scanDirectories", "true");<br>
aconf.setProperty("drools.agent.scanResources", "true");<br>
</div> /*<br>
* important newInstance has to be false in order to update the<br>
* knowledge base and not rebuild a new one<br>
*/<br>
aconf.setProperty("drools.agent.newInstance", "false");<br>
final KnowledgeAgent agent =<br>
KnowledgeAgentFactory.newKnowledgeAgent("pch.sel.knowledge.agent", aconf);<br>
<div class="im"> // if (_l.isDebugEnabled()) {<br>
/* we need some log every time */<br>
agent.setSystemEventListener(new PrintStreamSystemEventListener());<br>
<br>
</div>agent.applyChangeSet(ResourceFactory.newClassPathResource("pch.sel.kwset.xml"));<br>
// fire rules<br>
StatefulKnowledgeSession session =<br>
agent.getKnowledgeBase().newStatefulKnowledgeSession();<br>
session.fireAllRules();<br>
_l.warn("END");<br>
<br>
<br>
and here the rule<br>
<br>
<br>
package it.ipiu.drools.KnowledgeAgent.test<br>
<br>
rule "test rule" timer(int: 0s 2s)<br>
when<br>
eval(true);<br>
then<br>
System.out.println("ciao");<br>
end<br>
<br>
<br>
<br>
If I try to change timer from 2s to 2m nothing changes even if<br>
KnowledgeAgent seems to reload all.<br>
<br>
*Please help!!! I googled the problem everywhere without solution!!!*<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/KnowledgeAgent-Changeset-problems-tp3787165p3884201.html" target="_blank">http://drools.46999.n3.nabble.com/KnowledgeAgent-Changeset-problems-tp3787165p3884201.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</div></div></blockquote></div><br></div>