[rules-dev] [Bug]: 5.5.0: binding makes parser accept non-boolean constraint

Edson Tirelli ed.tirelli at gmail.com
Mon Feb 18 13:15:49 EST 2013


   Wolfgang,

   Thank you for reporting. Mario is fixing it.

   On a related note, for Drools 5, for backward compatibility, we still
allowed bindings in the middle of expressions. We were discussing if this
should be disallowed from Drools 6 forward? Things like:

Person( $name : name == "Bob" || $alive : isAlive && ($age : age > 40 ) )

   Things get quite complicated and a bit hard to read as expressions get
more complex. It also clashes with the ternary operator ?:.

   Any thoughts on retaining support for this kind of syntax or removing
it?

   Edson

On Mon, Feb 18, 2013 at 7:45 AM, Wolfgang Laun <wolfgang.laun at gmail.com>wrote:

> Below is a self-contained DRL which should not compile because the sum
> isn't a boolean expression. (Note that omitting "$x:" results in the
> correct diagnostic "predicate ... must be a boolean".)
>
> declare Foo
>   a: double
>   b: double
> end
>
> rule what
> when
>     $c: Foo( $x: a + b )
> then
>     System.out.println( "foo: " + $c );
> end
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20130218/b19281c1/attachment.html 


More information about the rules-dev mailing list