[rules-users] RE: Hot Deployment

Brian Trezise Brian.Trezise at intellidata.net
Mon Apr 7 18:22:58 EDT 2008


Ok, that helped.  However, I now have a different exception.  Does the rule
agent have the ability to monitor changes to the drl files in a directory,
or do I have to serialize the rules before it works?  Our goal is to deploy
the .drl files to our server and have the agent detect modified time stamps
or new files and auto-load them into the rule base

___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
3173 s. uravan way
aurora, colorado 80013
T: 720.524.4864
brian.trezise at intellidata.net

-----Original Message-----
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of
rules-users-request at lists.jboss.org
Sent: Monday, April 07, 2008 3:30 PM
To: rules-users at lists.jboss.org
Subject: rules-users Digest, Vol 17, Issue 18

Send rules-users mailing list submissions to
	rules-users at lists.jboss.org

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
	rules-users-request at lists.jboss.org

You can reach the person managing the list at
	rules-users-owner at lists.jboss.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."


Today's Topics:

   1. RE: Hot Deployment (Nico Schlebusch)


----------------------------------------------------------------------

Message: 1
Date: Mon, 7 Apr 2008 23:29:23 +0200
From: "Nico Schlebusch" <nicos at zieto.co.za>
Subject: RE: [rules-users] Hot Deployment
To: "Rules Users List" <rules-users at lists.jboss.org>
Message-ID: <BEEEB43B72EFA94A941C0D71C02752F82AE607 at tacora.dot.co.za>
Content-Type: text/plain; charset="us-ascii"

Hi Brian,

 

>> The goal here is to monitor the directory above for any changes to
the files or additional files that show up.  Any help would be
appreciated.

 

If you want to monitor a local dir try using the "dir" property instead
of "url". In your case you would then have something like:

            Properties prop = new Properties(); 
            prop.setProperty("dir",
"c:/svn/code/sleuth/src/net/intellidata/sleuth/description/rules/");

            prop.setProperty("poll", "300"); // poll every 300 seconds
for hot deployment.



I'm not sure if you would need these properties.

            prop.setProperty("newInstance", "true");
            prop.setProperty("localCacheDir", ".");



Have a look at Section 7.1.1. Deployment using the RuleAgent of the
online manual at
http://downloads.jboss.com/drools/docs/4.0.6.19326.GA/html/index.html

 

Regards,

Nico 

 

From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Brian Trezise
Sent: 07 April 2008 10:19 PM
To: paulb at firstpartners.net; 'Rules Users List'
Subject: RE: [rules-users] Hot Deployment

 

Ok... I put that in but I'm having trouble getting it to recognize the
uri I'm passing in...  I'm passing in
"file:///c:/svn/code/sleuth/src/net/intellidata/sleuth/description/rules
/" and I'm getting the following exception:

RuleAgent(default) INFO (Mon Apr 07 13:14:40 MDT 2008): Configuring with
newInstance=true, secondsToRefresh=300

RuleAgent(default) INFO (Mon Apr 07 13:14:40 MDT 2008): Configuring
package provider : URLScanner monitoring URLs:
file:/c:/svn/code/sleuth/src/net/intellidata/sleuth/description/rules/
with local cache dir of .

java.lang.ClassCastException:
sun.net.www.protocol.file.FileURLConnection

            at
org.drools.agent.HttpClientImpl.checkLastUpdated(HttpClientImpl.java:26)

            at
org.drools.agent.URLScanner.hasChanged(URLScanner.java:141)

            at
org.drools.agent.URLScanner.getChangeSet(URLScanner.java:108)

            at
org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:88)

            at
org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:330)

            at
org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:298)

            at org.drools.agent.RuleAgent.configure(RuleAgent.java:284)

            at org.drools.agent.RuleAgent.init(RuleAgent.java:208)

            at
org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:176)

            at
org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:148)

            at
net.intellidata.sleuth.description.rules.DescriptionRuleLoader.loadRules
(DescriptionRuleLoader.java:48)

            at
net.intellidata.sleuth.description.rules.DescriptionRuleLoaderTest.testD
escriptionRuleLoader(DescriptionRuleLoaderTest.java:32)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)

            at java.lang.reflect.Method.invoke(Unknown Source)

            at junit.framework.TestCase.runTest(TestCase.java:154)

            at junit.framework.TestCase.runBare(TestCase.java:127)

            at junit.framework.TestResult$1.protect(TestResult.java:106)

            at
junit.framework.TestResult.runProtected(TestResult.java:124)

            at junit.framework.TestResult.run(TestResult.java:109)

            at junit.framework.TestCase.run(TestCase.java:118)

            at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUn
it3TestReference.java:130)

            at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja
va:38)

            at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:460)

            at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:673)

            at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:386)

            at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:196)

 

The goal here is to monitor the directory above for any changes to the
files or additional files that show up.  Any help would be appreciated.

 

___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
3173 s. uravan way
aurora, colorado 80013
T: 720.524.4864
brian.trezise at intellidata.net

 

From: Paul Browne [mailto:paulb at firstpartners.net] 
Sent: Friday, April 04, 2008 3:56 PM
To: Brian.Trezise at intellidata.net; Rules Users List
Subject: Re: [rules-users] Hot Deployment

 

Brian,

I'm guessing that you mean the RuleAgent Class. The Javadoc on this
class gives more info.

Code sample (assuming that you have the BRMS setup as per the doc).
You'll need to change to whatever settings are appropriate for your
BRMS.

            Properties prop = new Properties(); 
            prop.setProperty("url",uri);
            prop.setProperty("newInstance", "true");
            prop.setProperty("localCacheDir", ".");
            prop.setProperty("poll", "300"); // poll every 300 seconds
for hot deployment.
            
            //Get a new RuleBase using these properties
            RuleAgent agent = RuleAgent.newRuleAgent(prop);
            RuleBase rb = agent.getRuleBase(); 

Then use the RuleBase as normal

Paul

Brian Trezise wrote: 

In the What's New? Section of the Drools 4.0 documentation there is a
reference in 1.1.2 to a "Rules Engine Agent for hot deployment and BRMS
integration".  This would be ideal for the application I am currently
developing.  However, this is the only mention of this agent anywhere in
the documentation.  Does anybody know anything about this, how to use
it, any documentation about it?

Thanks,

 

___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
3173 s. uravan way
aurora, colorado 80013
T: 720.524.4864
brian.trezise at intellidata.net

 

 
 
 



________________________________



 
 
 
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
  

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20080407/207442a9/a
ttachment.html

------------------------------

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


End of rules-users Digest, Vol 17, Issue 18
*******************************************




More information about the rules-users mailing list