<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Mark Proctor wrote:
<blockquote cite="mid:49477B34.2080301@codehaus.org" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
Paul Sentosa wrote:
  <blockquote cite="mid:822953.96666.qm@web52312.mail.re2.yahoo.com"
 type="cite">
    <style type="text/css"><!-- DIV {margin:0px;} --></style>
    <div
 style="font-family: arial,helvetica,sans-serif; font-size: 12pt;">
    <div>Hi,<br>
    <br>
Mark, thanks for the links and explanation.<br>
So if I use Guvnor for administrating my rules,<br>
- should I use the URL pointing to LATEST.DRL in change-set instead of
the one in package snapshot to get the latest version of rules?<br>
    <br>
- I assume the communication between my application and the Guvnor will
happen by the time applyChangeSet-method (which defines a resource by
pointing to the URL of DRL) is called and internally create package out
of it (compared to the method newRuleAgent("properties"). Is this
correct? Is there any significat difference in required
time/performance?<br>
    </div>
    </div>
  </blockquote>
I added file scanning, I haven't yet added http scanning, I'll do that
this week. the file and http scanning, work in the same manner as they
do for the original rule agent. If you look at the file scanner now,
you can see how to implement your own if you really need to. The
framework is now designed that people can built their own resource
monitors, so they can implement their own push based implementations.<br>
</blockquote>
Sorry I had a mind blank, and I'm talking complete bollocks. http does
work. The ResourceChangeScannerImpl is independant of the resource
type, as long as the resource type implements getLastModified() and
getLastRead() it will work, which the http one does. So in theory
whether file or http resources, it should work the same way as the old
rule agent. The only difference is the configuration is now in a
different location, if you need to change the interval. You now no
longer change the interval on the individual rule agent, but on the
service.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Properties props = new Properties();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; props.setProperty("drools.resource.scanner.interval", "30");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ResourceChangeScanner service =
ResourceFactory.getResourceChangeScannerService();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ResourceChangeScannerConfiguration rconf =
service.newResourceChangeScannerConfiguration(props);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; service.configure( rconf );<br>
<br>
Mark<br>
<blockquote cite="mid:49477B34.2080301@codehaus.org" type="cite"><br>
Mark<br>
  <blockquote cite="mid:822953.96666.qm@web52312.mail.re2.yahoo.com"
 type="cite">
    <div
 style="font-family: arial,helvetica,sans-serif; font-size: 12pt;">
    <div><br>
Again, thanks and appreciate your answer<br>
    <br>
Regards<br>
Paul<br>
    <br>
    </div>
    <div
 style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"><br>
    <div
 style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"><font
 face="Tahoma" size="2">
    <hr size="1"><b><span style="font-weight: bold;">From:</span></b>
Mark Proctor <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="mailto:mproctor@codehaus.org">&lt;mproctor@codehaus.org&gt;</a><br>
    <b><span style="font-weight: bold;">To:</span></b> Rules Users List
    <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="mailto:rules-users@lists.jboss.org">&lt;rules-users@lists.jboss.org&gt;</a><br>
    <b><span style="font-weight: bold;">Sent:</span></b> Tuesday,
December 16, 2008 9:22:22 AM<br>
    <b><span style="font-weight: bold;">Subject:</span></b> Re:
[rules-users] How to use KnowledgeAgent in the "old manner" (just like
RuleAgent)<br>
    </font><br>
psentosa wrote:<br>
&gt; Hi all,<br>
&gt; <br>
&gt; Can anyone give some explanation / examples on this? The docu is
still using<br>
&gt; ruleagent.<br>
&gt; I found some piece of codes within the KnowledgeAgentFactory, but
I saw that<br>
&gt; it uses the configuration object. <br>
The javadocs:<br>
    <a moz-do-not-send="true"
 href="https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/javadocs/stable/drools-api/org/drools/agent/KnowledgeAgent.html"
 target="_blank">https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/javadocs/stable/drools-api/org/drools/agent/KnowledgeAgent.html</a><br>
    <a moz-do-not-send="true"
 href="https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/javadocs/stable/drools-api/org/drools/ChangeSet.html"
 target="_blank">https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/javadocs/stable/drools-api/org/drools/ChangeSet.html</a><br>
    <br>
There are a number of unit tests you can follow:<br>
    <a moz-do-not-send="true"
 href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentTest.java"
 target="_blank">http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/agent/KnowledgeAgentTest.java</a><br>
    <br>
    <a moz-do-not-send="true"
 href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/xml/changeset/ChangeSetTest.java"
 target="_blank">http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/xml/changeset/ChangeSetTest.java</a><br>
    <br>
    <a moz-do-not-send="true"
 href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-decisiontables/src/test/java/org/drools/decisiontable/ChangeSetTest.java"
 target="_blank">http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-decisiontables/src/test/java/org/drools/decisiontable/ChangeSetTest.java</a><br>
    <a moz-do-not-send="true"
 href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-decisiontables/src/test/resources/org/drools/decisiontable/"
 target="_blank">http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-decisiontables/src/test/resources/org/drools/decisiontable/</a><br>
&gt; I personally prefer the old style by using<br>
&gt; a property file in which the configuration is defined.<br>
&gt;&nbsp; <br>
The properties file does not offer enough flexibilility to support all
resource types - the xml really is quite simple - how do you specify
the worksheet name for a decision tree? In some ways it's actually
simpler and more powerful, as there is no separate line for
directories, it's just another resource and it detects that it's a
directory. ChangeSets will eventually support remove and modify, for
incremental knowledgebase changes, so the properties file just doesn't
cut it.<br>
    <br>
&lt;change-set&gt;<br>
&nbsp; &lt;add&gt;<br>
&nbsp; &nbsp; &lt;resource source='<a moz-do-not-send="true"
 href="http://www.domain.com/test.drl%27" target="_blank">http://www.domain.com/test.drl'</a>
type='DRL' /&gt;<br>
&nbsp; &nbsp; &lt;resource source='<a moz-do-not-send="true"
 class="moz-txt-link-freetext" href="file://data/somedir">file://data/somedir</a>'
type='DRL' /&gt;<br>
&nbsp; &nbsp; &lt;resource source='<a moz-do-not-send="true"
 href="http://www.domain.com/test.xls%27" target="_blank">http://www.domain.com/test.xls'</a>
type='DTABLE' &gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;decisiontable-conf worksheet-name='sheet10'
input-type='XLS' /&gt;<br>
&nbsp; &nbsp; &lt;/resource&gt;<br>
&lt;/add&gt;&nbsp; &nbsp; &nbsp; &nbsp; &lt;/change-set&gt;<br>
    <br>
    <br>
Mark<br>
    <br>
    <br>
&gt; Thanks in advance for any help<br>
&gt; <br>
&gt; Regards<br>
&gt; Paul<br>
&gt;&nbsp; <br>
    <br>
    <br>
_______________________________________________<br>
rules-users mailing list<br>
    <a moz-do-not-send="true"
 ymailto="mailto:rules-users@lists.jboss.org"
 href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
    <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
    </div>
    </div>
    </div>
    <br>
    <pre wrap=""><hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
  </blockquote>
  <br>
</blockquote>
<br>
</body>
</html>