Hi Michael,

I think I found a work around.  All I had to do is include the "fact" 
menuNavItem in the "eval" in some manner. I included the "&& menuNavItem != 
null" which I know must always be true and it works.  I had this problem on all 
the rules I had an "eval" but didn't have the "fact" referenced.

Thanks for your help
George

rule "Menu Dependents Not Elig"
        when
                menuNavItem : MenuNavItem( id == NavConstants.NAV_DEPENDENTS )
                // Can't have Dependents without HW Plans.
                // Bug must reference menuNavItem in eval for it to work.
                eval( !navService.haveHWPlans() && menuNavItem != null )
        then
                System.out.println( "Menu Dependents Not Elig: 
"+menuNavItem.getId() ); 
                retract( menuNavItem );
end

-----Original Message-----
From: Michael Neale [mailto:[EMAIL PROTECTED]
Sent: Monday, May 01, 2006 7:54 PM
To: user@drools.codehaus.org
Subject: Re: [drools-user] Rule Compilation error


Hi George.

Is it possible to have the MenuNavItem and other objects so we can reproduce
this?

I do know there was a bug in RC2 to do with evals, not sure if it is fixed
but I would like to confirm this, or fix and add it as a test.

On 5/2/06, Gerolimos George <[EMAIL PROTECTED]> wrote:
>
> Can someone help me with this? The rule doesn't have any commas.  It calls
> a "global" objects (navService) boolean methods.  If the "eval" is commented
> out it works.  I've used the global object in other more complicated rules
> and it works fine.
>
> rule "Menu Dependents Not Elig"
>         when
>                 menuNavItem : MenuNavItem( id ==
> NavConstants.NAV_DEPENDENTS )
>                 // Can't have Dependents without HW Plans.
>                 eval( !navService.haveHWPlans() )
>         then
>                 System.out.println( "Menu Dependents Not Elig:
> "+menuNavItem.getId() );
>                 retract( menuNavItem );
> end
> .
>
> org.drools.rule.InvalidRulePackage: Rule Compilation error Syntax error on
> token ",", delete this token
>
>         at org.drools.rule.Package.checkValidity(Package.java:378)
>         at org.drools.reteoo.RuleBaseImpl.addPackage(RuleBaseImpl.java
> :303)
>         at org.drools.jsr94.rules.admin.RuleExecutionSetImpl.<init>(
> RuleExecutionSetImpl.java:117)
>         at
> org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet
> (LocalRuleExecutionSetProviderImpl.java:183)
>         at
> org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet
> (LocalRuleExecutionSetProviderImpl.java:127)
>         at com.mhris.common.rules.RuleEngineFacade.addRuleExecutionSet(
> RuleEngineFacade.java:50)
>         at
> com.mhris.benefits.navigation.StatelessRuleSessionTestCase.setUp(
> StatelessRuleSessionTestCase.java:61)
>         at junit.framework.TestCase.runBare(TestCase.java:125)
>         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:118)
>         at junit.framework.TestSuite.runTest(TestSuite.java:208)
>         at junit.framework.TestSuite.run(TestSuite.java:203)
>         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
> (RemoteTestRunner.java:481)
>         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> RemoteTestRunner.java:347)
>         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:197)
>
>
> Thanks
> George
>
> The information contained in this e-mail may be confidential and is
> intended solely for the use of the named addressee.
> Access, copying or re-use of the e-mail or any information contained
> therein by any other person is not authorized.
> If you are not the intended recipient please notify us immediately by
> returning the e-mail to the originator.(16b)
>
>
 
The information contained in this e-mail may be confidential and is intended 
solely for the use of the named addressee.
Access, copying or re-use of the e-mail or any information contained therein by 
any other person is not authorized.
If you are not the intended recipient please notify us immediately by returning 
the e-mail to the originator.(16b)

Reply via email to