JBoss Rules 4.0MR2
I'm trying to load my rules using a drl file with a dsl file. I've based this
upon the conway example. The problem is each time I start my application and
load the files I get the following error message:
Caused by:
org.drools.rule.InvalidRulePackage: [8,0]: unknown:8:0 required (...)+ loop
(decision=2) did not match anything;
token=[@18,159:166='expander',<34>,8:0]
at org.drools.rule.Package.checkValidity(Package.java:368)
Because I am using Spring Modules and configuring JBoss Rules with the Jsr94
packages I am having to specify the dsl file as a property passed into the
DefaultRuleSource. The key is the name of the dsl expander (order-release.dsl)
and the value is the contents of the file as a String.
Here is my order-release.drl file:
package com.sybase.it.cosmos.rules
expander order-release.dsl
import com.sybase.it.cosmos.rules.logic.Order;
# The Order's total Amount exceeds the Maximum allowable amount
rule "Maximum Order Amount Exceeded"
salience 9800
when
An Order amount exceeds 100000
then
Manually release the Order with code "AR_001"
end
Here is my order-release.dsl file:
[condition][order]An Order amount exceeds {number} =order : Order( releasable ==
true , amount >= {number})
[consequence][order]Manually release the Order with code
"{resourceCode}"=order.setForManualRelease("{resourceCode}");retract(order);
[consequence][order]Release the order=order.setForAutoRelease();retract(order);
Show replies by date
Chris Mathrusse <christopher.mathrusse <at> sybase.com> writes:
After stepping through the code a bit I learned that the Spring class
LocalRuleExecutionSetProviderImpl is looking for the key dsl in the properties
object that is passed in and that it expects the value object in the hash table
to be either a java.io.Reader or a String object containing the contents of the
dsl file. So I modified my configuration to pass in an instance of Reader for
the dsl file. Now when I load the application and it check for validity of the
rules I receive the following error:
Caused by:
org.drools.rule.InvalidRulePackage:
org.drools.lang.ExpanderException
@993028org.drools.lang.ExpanderException
@128b33aorg.drools.lang.ExpanderException
@10ea988org.drools.lang.ExpanderException
@19c4844org.drools.lang.ExpanderException
@14c8f24org.drools.lang.ExpanderException
@1498526org.drools.lang.ExpanderException
@1c4a760org.drools.lang.ExpanderException
@1c8ce14org.drools.lang.ExpanderException
@51b326org.drools.lang.ExpanderException
@1c8997eorg.drools.lang.ExpanderException
@d54d3forg.drools.lang.ExpanderException
@1c26386org.drools.lang.ExpanderException
@1140cf6org.drools.lang.ExpanderException
@15efa6aorg.drools.lang.ExpanderException
@8a750aorg.drools.lang.ExpanderException
@9e6e0org.drools.lang.ExpanderException@14b389
at org.drools.rule.Package.checkValidity(Package.java:368)
Any ideas as to what might be causing this?
Thanks for the help...