[rules-users] Problem loading drl with dsl
Chris Mathrusse
christopher.mathrusse at sybase.com
Fri Jun 8 13:53:03 EDT 2007
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);
More information about the rules-users
mailing list