Drools 3.0.6 - API compiler gone crazy.
I’ve become very friendly with Drools 3.0.6. So friendly that I am beginning to have fights about eachothers faults.
This one is the newest one I found.
Long story short, I implemented usage of DSL with DRL. This method made it easier on the non-technical people to read the rule files. Syntactically, DRL needs to identify a proper DSL in order to work properly. When I say “proper”, I mean existing file. Check out this example:
package rule.sample.anjoe
import anjoe.test.pojo1;
expander anjoeDsl.dsl
Above is the first three lines in my DRL file. The “expander” keyword identifies which dsl mapping file is used for this DRL. Have you ever tried to put wrong DSL file name as the expander value? The Eclipse IDE will immidiately tell you that there is an error. But what about when compiling the rules using the API in online application environment?
The standard java code is used to read in the DRL and DSL files from the file location using Reader object. You create new PackageBuilder object and call addPackageFromDRL method with two parameters; DrlReader and DslReader. As far as compiler is concerned, both DRL and DSL files needs to be valid without any errors. If errors exists, like wrong DSL file name as expander value, the method call should fail. RIGHT? apparently NOT!!!!
When compiling the rules through JAVA API, as long as you pass in proper DRL and DSL reader object into the addPackageFromDRL method, it compiles and everything is honkie-dorie~
In Eclipse IDE, this is a no no for built in IDE rules compiler will bitch at you right away.
Has anyone come across this? Shoot me an email. joe@anjoedesign.com