[
http://jira.jboss.com/jira/browse/JBRULES-1321?page=all ]
Edson Tirelli closed JBRULES-1321.
----------------------------------
Resolution: Done
I fixed the NPE on the parser, but the used syntax was not valid. The "," can
not be embedded in complex expressions. '&&' should be used instead.
not(UserRole((role == Role.TIMEKEEPER && delegateFor == $supId) || (role==
Role.SUPERVISOR && delegateFor == $tkpId)) from $actorRoles)
From the manual, section 6.5.2.1:
"Also, it is important to note that besides having the same semantics, the
connectives '&&' and ',' are resolved with different priorities
and ',' cannot be embedded in a composite constraint expression."
Thanks for reporting and providing test case.
org.drools.compiler.DroolsParserException: Unknown error while
parsing.
org.drools.compiler.DroolsParserException: Unknown error while parsing.
>
------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: JBRULES-1321
> URL:
http://jira.jboss.com/jira/browse/JBRULES-1321
> Project: JBoss Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Drl Parser/Builder
> Affects Versions: 4.0.3
> Reporter: Edson Tirelli
> Assigned To: Edson Tirelli
> Fix For: 4.0.4, 4.1.0
>
>
> I have a compound LHS statement that is causing the parser to fail.
> Here is my exact stacktrace:
org.drools.compiler.DroolsParserException: Unknown error while
parsing.
> This is a bug. Please contact the Development team.
> at org.drools.compiler.DrlParser.compile(DrlParser.java:183)
> at org.drools.compiler.DrlParser.parse(DrlParser.java:61)
> at
> org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:165)
> at
>
com.kronos.webta.service.security.access.rules.WriteRestrictionsRulesTest.setUpBeforeClass(WriteRestrictionsRulesTest.java:58)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> org.junit.internal.runners.ClassRoadie.runBefores(ClassRoadie.java:49)
> at
> org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:36)
> at
> org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
> at
>
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> at
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> at
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> at
>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> This is the statement that is causing me problems:
> not(UserRole((role == Role.TIMEKEEPER, delegateFor == $supId) || (role
> == Role.SUPERVISOR, delegateFor == $tkpId)) from $actorRoles)
> Remote out one of the conditions from the ||, it compiles fine. Such
> as:
> not(UserRole(role == Role.SUPERVISOR, delegateFor == $supId) from
> $actorRoles)
> or
> not(UserRole(role == Role.TIMEKEEPER, delegateFor == $tkpId) from
> $actorRoles)
> Is my syntax incorrect or is there a bug?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira