I've finished my first small application using JBoss Rules. My current
deployment "strategy" is that I want to have a single executable .jar file
containing my application and an external (not included in the .jar) folder
that contains the rules that should be used.
Unfortunately, this seems to be harder, than I thought, as my application
refuses to use .drl or .dsl files that are outside of the package.
I'm quite sure that it's just my misunderstanding of the manual that leads
to the problem, as this seems to be one of the most basic deployment
approaches, as stated by the manual:
Chapter 7. Deployment and Testing
7.1. Deployment options
Once you have rules integrated in your application (or ideally before) you
will need to plan how to deploy rules along with your application. Typically
rules are used to allow changes to application business logic without
re-deploying the whole application. This means that the rules must be
provided to the application as data, not as part of the application (eg
embedded in the classpath).
Unfortunately I have quite some problems understanding the rest of the
chapter. So I just used and modified on of the given examples.
//read in the source
Reader source = new
//read in the DSL
Reader dsl = new
//Use package builder to build up a rule package.
//An alternative lower level class called "DrlParser" can also be used...
PackageBuilder builder = new PackageBuilder();
//Use the following instead of above if you are using a DSL:
If I use
KNOWLEDGE_FILE = "/Rules_withDsl.drl";
DOMAINSPECIFICLANGUAGE_FILE = "/Rules_withDsl.dsl";
it all works wonderfully... but then the rules are within my .jar :-(
So I tried to change this into a folder outside the package:
KNOWLEDGE_FILE = "C:/test/Rules_withDsl.drl";
DOMAINSPECIFICLANGUAGE_FILE = "C:/test/Rules_withDsl.dsl";
Now, it doesn't work any more, because the "getResourceAsStream" returns
View this message in context:
Sent from the drools - user mailing list archive at Nabble.com