Ugh, it appears to have something to do with binding expiresOn on the first
line. I need to bind it there otherwise my evals won't work on lines 2 and
3. Seems like a bug. no?


jwheeler1 wrote:
> 
> I am having a problem with what appears to be the 4th line down. the
> 'status' field.
> 
> [when]There is a Policy=policy : PolicyStatus(expiresOn : expiresOn)
> [when]- today is {n} days before or {m} days after expiration=eval(
> expiresOn != null && inDateRange(subtractDays(expiresOn, {n}),
> addDays(expiresOn, {m}), now()) )
> [when]- today is {n} days after expiration=eval( expiresOn != null &&
> expiresOn.compareTo(subtractDays(now(), {n})) <= 0 )
> [when]- with status "{status}"=status == "{status}"
> [then]Notify {notification}=policy.addMessage({notification});
> 
> I have read one other similar thread, that boiled down to not having a
> space after the dash. I do have a space.
> I am getting 
> 
> java.lang.ExceptionInInitializerError
>       at
> com.pgac.mypolicy.model.TestPolicyStatusRulesEngine.testPolicyExpiresIn24Days(TestPolicyStatusRulesEngine.java:37)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
>       at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
>       at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
>       at java.lang.reflect.Method.invoke(Method.java:391)
>       at junit.framework.TestCase.runTest(TestCase.java:164)
>       at junit.framework.TestCase.runBare(TestCase.java:130)
>       at junit.framework.TestResult$1.protect(TestResult.java:106)
>       at junit.framework.TestResult.runProtected(TestResult.java:124)
>       at junit.framework.TestResult.run(TestResult.java:109)
>       at junit.framework.TestCase.run(TestCase.java:120)
>       at junit.framework.TestSuite.runTest(TestSuite.java:230)
>       at junit.framework.TestSuite.run(TestSuite.java:225)
>       at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:436)
>       at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:311)
>       at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
> Caused by: java.lang.RuntimeException: org.drools.rule.InvalidRulePackage:
> unknown:33:9 Unexpected token '=='
> 
>       at
> com.pgac.mypolicy.model.PolicyStatusRulesEngine.<clinit>(PolicyStatusRulesEngine.java:46)
>       ... 17 more
> Caused by: org.drools.rule.InvalidRulePackage: unknown:33:9 Unexpected
> token '=='
> 
>       at org.drools.rule.Package.checkValidity(Unknown Source)
>       at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)
>       at
> com.pgac.mypolicy.model.PolicyStatusRulesEngine.<clinit>(PolicyStatusRulesEngine.java:44)
>       ... 17 more
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Error-with-new-dsl-field-constraint-syntax-tf2501764.html#a6975141
Sent from the drools - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to