I'm pretty new to Drools and I think the BRMS in 4.0.2 is great. I've
encountered a few issues that I wanted to bring up. I can put some or
all of these into JIRA if that's best, but I wanted to bring them up
here first in case it's just user error on my part.
=== Issue #1 ===
For our project we want to use a DSL in the BRMS. The error messages
that are shown when you click "Validate" when editing a business rule
that uses a DSL in the BRMS are not user-friendly at all. If I make a
small typo and misspell the name of an attribute (a very likely thing
for a BRMS user to do), and click the Validate button, the error I get
back is a big stack trace starting with "java.lang.RuntimeException:
SNO: Conversion failed at
org.codehaus.janino.UnitCompiler.numericPromotion(UnitCompiler.java)
at …" Nowhere in that stack trace is anything that gives a hint that
the error is just a typo of an attribute name.
Contrast this with the rather helpful error message I get if I make
the same typo when editing a DRL rule: "Unable to create Field
Extractor for 'overtimHours'". (The error is that I misspelled
overtimeHours). Is it possible to get the same type of helpful error
messages on validation when editing a DSL rule?
Just to be clear, I'm talking about the rules that use the DSL (which
I want our business users to edit), not the DSL grammar itself (which
will be modified by developers).
=== Issue #2 ===
The BRMS doesn't allow rules to have an apostrophe character in them.
I stumbled into this one when I attempted to import a .drl file where
the first rule was named "Set employee's minimum wage". This .drl file
works fine outside the BRMS.
Here's the first few lines of the rule file:
--------------------------
package com.example
import com.example.Employee;
import function com.example.RuleHelper.logNumber;
expander Wage.dsl
rule "Set employee's minimum wage"
when
--------------------------
When I try to import it into the BRMS I got a very strange error back
(including the <pre> tags): "Unable to import into the package.
[<pre>Unable to process import: javax.jcr.RepositoryException: failed
to resolve path Set employee's minimum wage relative to
/drools:repository/drools:package_area/com.soi/assets: Invalid name:
Set employee's minimum wage: Invalid name: Set employee's minimum
wage</pre>]".
Later when I tried to manually enter the rules in that file through
the BRMS I figured out the real cause was the ' character in the rule
name. I was unable to create a rule with an apostrophe in the name.
The error stack trace says "An error occurred executing the action.
Details
com.google.gwt.user.client.rpc.SerializableException:
javax.jcr.RepositoryException: failed to resolve path Set employee's
minimum wage relative to
/drools:repository/drools:package_area/com.example/assets: Invalid
name: Set employee's minimum wage: Invalid name: Set employee's
minimum wage at
org.drools.brms.server.ServiceImplementation.createNewRule(ServiceImplementation.java:166)..."
=== Issue #3 ===
I've developed a DSL for my project, and as recommended in the
documentation (section 6.7.3) I renamed my .drl files to .dslr. When I
started to use the BRMS, I was not able to import a file with a .dslr
extension. Renaming the file to .drl worked around the problem. I
think the BRMS should allow importing of .dslr files.
=== Issue #4 ===
This one is pretty minor. When creating a new rule asset through the
BRMS using the type "Business rule using a DSL (text editor)", the
initial description you put in is ignored. You always get the
description "A dsl is a language mapping from a domain specific
language to the rule language."
As I said, I'm happy to create JIRA tickets for all of the above if
that's what you'd like. I'm pretty new to Drools, so I thought I'd
post the issues here first for feedback.
Thanks,
Phil