[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1422) Prefix 'and' and infix 'and' not interchangeable

Edson Tirelli (JIRA) jira-events at lists.jboss.org
Wed Apr 16 18:36:44 EDT 2008


    [ http://jira.jboss.com/jira/browse/JBRULES-1422?page=comments#action_12409241 ] 
            
Edson Tirelli commented on JBRULES-1422:
----------------------------------------

Just as examples, for documentations purposes, both rules should work:

rule "no one likes cheeses 1"
when
    not( Person( $likes : likes ) and
            Cheese( type == $likes )
          )
then
    // do something
end

rule "no one likes cheeses 2"
when
    not( and Person( $likes : likes ) 
            Cheese( type == $likes )
          )
then
    // do something
end


> Prefix 'and' and infix 'and' not interchangeable
> ------------------------------------------------
>
>                 Key: JBRULES-1422
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-1422
>             Project: JBoss Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Drl Parser/Builder
>    Affects Versions: 4.0.2
>            Reporter: Alexandre Gattiker
>         Assigned To: Edson Tirelli
>             Fix For: 5.0.0-M1
>
>
> 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.

-- 
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

        



More information about the jboss-jira mailing list