The DSRL line ends with "... Coverage *C*" but the DSL definition ends with
"...Coverage *A*"
-W
2011/3/10 Saleem Lakhani <Saleem.Lakhani(a)citizensfla.com>
Here are the details:
This is how my rule looks like:
//Imports for TO and MathHelper
*global* com.h.MathHelper math;
*rule* "Coverage must equal 20% of Coverage C"
*auto-focus* *true*
*agenda-group* "C"
*when*
Coverage information *exists*
Coverage *is* *not* equal to "20" percent of Coverage C
*then*
do something
*end*
* *
[when]There is a Coverage with=covTO : CovTO()
[when]Coverage is not equal to "{value}" percent of Coverage
A=*eval*(math.calculatePercentage(coveTO.getCoverage(),
covTO.getD()) != "{value}")
Error: Unable to expand: Coverage is not equal to "20" percent of Coverage
C[34,2]: [ERR 101] Line 34:2 no viable alternative at input 'Coverage' in
rule "Coverage must equal 20% of Coverage C"[34,20]: [ERR 101] Line 34:20 no
viable alternative at input 'equal' in rule "Coverage must equal 20% of
Coverage C"
Thanks,
saleem
*From:* rules-users-bounces(a)lists.jboss.org [mailto:
rules-users-bounces(a)lists.jboss.org] *On Behalf Of *Wolfgang Laun
*Sent:* Thursday, March 10, 2011 12:42 PM
*To:* Rules Users List
*Subject:* Re: [rules-users] eval in DSL
Can't help you - not enough context.
* What's the error?
* How is it used, especially preceding [when] clauses, where covTO ought to
get defined
-W
2011/3/10 Saleem Lakhani <Saleem.Lakhani(a)citizensfla.com>
How do we get this done in Drools 5.2.1:
[when]Cov is not equal to "{value}" percent of Coverage A =
*eval*(math.calculatePercentages(covTO.getCoverage(),
covTO.getD()) != {value})
This used to compile in Drools 3.
Thanks
saleem
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users