
-------------
Fernando runs a dodgy fly by night insurance operation in Sao Paulo, Brasil. These are his rules - would you buy insurance from him ? (I wouldn't).
This example takes you through the key steps in using the BRMS with an example respository, and using rules in a very very simple application (which you can use as a basis for your applications).
- Download the latest version of BRMS from http://cruisecontrol.jboss.com/cc/artifacts/jboss-rules
- Deploy BRMS WAR file into JBoss4.2 AS or JBossWeb, other containers can be used as well (possibly with some tweaking of dependencies).
- Check you can access and run the BRMS.
- Check out the demo project from the Drools subversion repository (this will be included in future distributions): http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-examples/drools-examples-brms/
- Import the demo business rules insurance repository file into BRMS, the compressed can be found at "files" folder in the demo project.
- To do this, open the "files" directory, unzip the file there locally, and then go to the "Admin" section and "Manage backups" of the BRMS, select the file, and press "Import" - follow instructions.
- Navigate through the BRMS web application to see how things are placed and organized and try to create some rules.
- Go to the "Packages" feature and build the package (you should see no errors).
- Now go to the "Deployment" feature, when you click on the package, it will show you one snapshot (which was part of the import, you can create more if you like from the previous step).
- Open a snapshot.
- Copy the snapshot url that is displayed.
- Locate the file brmsdeployedrules.properties
- Place the copied URL in the brmsdeployedrules.properties file.
- OPTIONAL: To use a file or directory deployment in the rule agent just update brmsdeployedrules.properties according the documentation.
- Import the example project into eclipse and execute the MainClass. The program will show the following trace (and away you go !):
RuleAgent(insuranceconfig) INFO (Thu Jul 12 20:06:02 BRT 2007): Configuring with newInstance=true, secondsToRefresh=30
RuleAgent(insuranceconfig) INFO (Thu Jul 12 20:06:02 BRT 2007): Configuring package provider : URLScanner monitoring URLs: http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.acme.insurance/fmeyer With local cache dir of /Users/fernandomeyer/projects/jbossrules/drools-examples/drools-examples-brms/cache
RuleAgent(insuranceconfig) INFO (Thu Jul 12 20:06:02 BRT 2007): Applying changes to the rulebase. RuleAgent(insuranceconfig) INFO (Thu Jul 12 20:06:02 BRT 2007): Creating a new rulebase as per settings.
RuleAgent(insuranceconfig) INFO (Thu Jul 12 20:06:02 BRT 2007): Adding package called org.acme.insurance
APPROVED: due to no objections.
APPROVED: Driver is safe and mature.
APPROVED: due to no objections.
REJECTED: Too many accidents
The Rule Agent will pick up any changes that happen automatically - as soon as you create a new snapshot of the rules you want to deploy.

I try this on tomcat and i have the next output:
ReplyDeleteRuleAgent(insuranceconfig) INFO (Thu Jul 19 11:35:15 CEST 2007): Configuring with newInstance=true, secondsToRefresh=30
RuleAgent(insuranceconfig) INFO (Thu Jul 19 11:35:15 CEST 2007): Configuring package provider : URLScanner monitoring URLs: http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.acme.insurance/InsuranceSnapshot with local cache dir of D:\workspace2\drools-example-brms\cache
RuleAgent(insuranceconfig) WARNING (Thu Jul 19 11:35:15 CEST 2007): Falling back to local cache.
java.lang.NullPointerException
I too tried the same example and was getting the following exception :-
ReplyDeleteRuleAgent(insuranceconfig) INFO (Tue Jul 24 15:37:23 EDT 2007): Configuring with newInstance=true, secondsToRefresh=30
RuleAgent(insuranceconfig) INFO (Tue Jul 24 15:37:23 EDT 2007): Configuring package provider : URLScanner monitoring URLs: http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.acme.insurance/fmeyer with local cache dir of C:\Vinu\Workspace_V3.3\drools-example-brms\cache
RuleAgent(insuranceconfig) WARNING (Tue Jul 24 15:37:24 EDT 2007): Falling back to local cache.
java.lang.NullPointerException
at org.drools.agent.FileScanner.readPackage(FileScanner.java:104)
at org.drools.agent.FileScanner.getChangeSet(FileScanner.java:79)
at org.drools.agent.FileScanner.loadPackageChanges(FileScanner.java:57)
at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:93)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:297)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:265)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:251)
at org.drools.agent.RuleAgent.init(RuleAgent.java:183)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:192)
at org.acme.insurance.launcher.InsuranceBusiness.loadRuleBase(InsuranceBusiness.java:26)
There was a change made to the local cache dir to point to the local directory.
It would be great if you can reply to this post..
Thanks,
Vinumes
please use the mailing lists for technical help.
ReplyDeleteThe link to the demo is no longer available. http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-examples/drools-examples-brms/ returns 404
ReplyDeleteCan you help?
As the link says please use the mailing list for questions on getting the example running. The example is now bundled with the standalone BRMS, there is a README in the download which details how to install the example repository in the BRMS.
ReplyDeleteI still wonder why using GWT instead of Seam-JSF. Any specific reason?
ReplyDeleteWe do use Seam with GWT, in fact Michael Neale wrote the Seam integration. We chose GWT as it provides a much richer and more scalable environment for Rich Client Applications.
ReplyDeleteJust out of curiosity. Wouldn't it be better to use your own portfolio (Seam-JSF-RichFaces) to reuse & boost these projects. Furthermore to find/create components which can be also used for the JBoss Admin View or similar?
ReplyDeleteI have to admit I personally don't like (or even hate) the "closed src-compiler" of GWT.
Just giving some thoughts. No offense meant.
no, I don't subscribe to "eating your own dog food" - we use the best tech regardless. Doing what we have done with GWT would just be too hard with JSF, not forgetting the fact that current JSF implementations simple doesn't scale well for complex apps, the sites bog down quickly.
ReplyDeleteHmm is that you Burr posting anonymously? ;)
ReplyDeleteN.B. Burr is our Product Manager and king promoter of "eating your own dog food" :)
No I'm not Burr. Even though I would love to be to kick your ass for choosing GWT. *scnr* ;)
ReplyDeleteSimply trying to understand why someone would choose a closed src tool for such a project, especially when they have something "similar" in their portfolio.
But I got your points. Thanks for sharing your opinions and answering that fast.
Google open sourced all of the GWT components ages ago, it just did it in a phased fashion:
ReplyDeleteGoogle Web Toolkit Goes Fully Open Source
These are the great blogs; I assure you that I really enjoyed a lot in readingmaryland home owner insurance
ReplyDeletecongratulations guys, quality information you have given!!! cheaplifeinsurance
ReplyDelete