[rules-users] return value restriction: not all expressions supported?

Edson Tirelli ed.tirelli at gmail.com
Thu Dec 16 10:43:07 EST 2010


   MVEL or Java?

   Edson

2010/12/16 Wolfgang Laun <wolfgang.laun at gmail.com>:
> Using 5.1.1 and knowing that "a Return Value restriction is a parenthesized
> expression composed from literals, any valid Java primitive or object,
> previously bound variables, function calls, and operators" I wrote
>
>   OperatorOrder( $code: code, $id1: elId1, $id2: elId2 )
>   CommandCode( code == $code, operands != ( $id1!=null ? ($id2!=null ? 2 :
> 1) : 0 ) )
>
> and got the erroneous error message:
>    Rule Compilation error : [Rule name='operator command: invalid number of
> elements']
>
> appl/domain/element/Rule_operator_command__invalid_number_of_elements_0.java
> (9:714) : $id2 cannot be resolved
>
> Variations in the return value restriction show that it is the nesting of
> -?-:- which causes the bug; a similar (but not equivalent) expression
>
>    operands != ( ($id1!=null ? 1:0) + ($id2!=null ? 1:0) )
>
> is accepted.
> -W
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com




More information about the rules-users mailing list