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@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Brian Trezise
Sent: 07 April 2008 10:19 PM
To: paulb@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.testDescriptionRuleLoader(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(JUnit3TestReference.java:130)

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

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

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

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

            at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.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@intellidata.net

 

From: Paul Browne [mailto:paulb@firstpartners.net]
Sent: Friday, April 04, 2008 3:56 PM
To: Brian.Trezise@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@intellidata.net

 

 
 
 



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