Bug 724206 (BRMS-149)

Summary: Prefix 'and' and infix 'and' not interchangeable
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: nwallace <nwallace>
Component: unspecifiedAssignee: Edson Tirelli <ed.tirelli>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: high    
Version: unspecified   
Target Milestone: ---   
Target Release: 5.0.1   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/BRMS-149
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-01 12:15:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description nwallace 2009-07-07 12:15:50 UTC
Date of First Response: 2009-09-10 00:18:06
Workaround Description: use double () when using not with infix CEs:

either:

not( A() and B() )

or:

not( (and A() B() ) )

securitylevel_name: Public

The documentation on the 'and' Conditional Element seems to imply that these constructs are equivalent:

		$p1:Entity($code1:code)
		not (and
			$p2:Entity(code == $code1)
			 eval(MyStaticClass.match($p1, $p2))
		)

		$p1:Entity($code1:code)
		not (
			$p2:Entity(code == $code1)
			and eval(MyStaticClass.match($p1, $p2))
		)

Actually, the first version crashes with this message:

unknown:93:7 Unexpected token 'and'[96,2]: unknown:96:2 mismatched token: [@792,3685:3685=')',<12>,96:2]; expecting type THEN

I'm on drools 4.0.2 and mvel14-1.2.8.

Comment 1 nwallace 2009-07-07 12:17:00 UTC
Link: Added: This issue is related to JBRULES-1422


Comment 2 nwallace 2009-07-07 12:17:39 UTC
Link: Added: This issue related JBRULES-1422


Comment 3 nwallace 2009-07-07 12:18:29 UTC
Link: Removed: This issue related JBRULES-1422 


Comment 4 nwallace 2009-09-01 12:15:54 UTC
Fix in place.

Comment 5 David Le Sage 2009-09-10 04:18:06 UTC
For the errata in the release notes, we require details of:


1.  the FIX (what was changed in the new parser to eliminate this bug).


Dot points will be fine.

Comment 6 David Le Sage 2009-09-23 05:23:11 UTC
We are still awaiting the outstanding information for the Release Notes on this one.  Please provide it as soon as possible. Thanks.

Comment 7 Edson Tirelli 2009-09-24 14:33:34 UTC
The FIX (what was changed to eliminate this bug) and
 * The language grammar used by the new parser was changed to not require double () when using prefix conditional elements.



Comment 8 Dana Mison 2009-10-05 07:08:44 UTC
added as resolved to the 5.0.CP01 release notes:

JBRULES-1422
Conditions using prefix conditional elements would not compile unless they were enclosed by parentheses. The grammar parser has been updated to remove this limitation.