[rules-dev] "New in 5.2.0" - What works, what doesn't?

Edson Tirelli ed.tirelli at gmail.com
Thu May 5 19:14:09 EDT 2011


   Wolfgang,

   These are remaining bugs that must be fixed before final. Goal is to
support free form expressions as long as they return a boolean value (for
traditional constraints), or any value (for positional). Period.

   Edson

2011/5/5 Wolfgang Laun <wolfgang.laun at gmail.com>

> In the 5.2.0 Drools Introduction and General User Guide, there's section
> 2.1.3.1, Free Form expressions in Constraints (New Parser). It contains
> several examples:
> #1 Person( age * 2 > $anotherPersonsAge + 2 )
> #2 Person( addresses["home"].streetName.startsWith( "High Park" ) )
> #3 Person( isAdult() )
>
> #1 does not compile: Unable to build constraint as  'age * 2' is invalid :
> [Rule name='exa1']
>
> #2 works - although I'd very much prefer not to be swamped with MVEL
> extensions unless I ask for it.
>
> #3 does not compile: Unable to Analyse Expression isAdult():
> [Error: no such identifier: isAdult]
> [Near : {... isAdult() ....}]
>
> Neither rule name nor line number is provided.
>
> Would it please be possible to have a precise statement what one *can*write as a constraint?
>
>
> <quote>
> This was also important for us to start to move towards a single consistent
> grammer for both the "when" left hand side and "then" right hand side.
> </quote>
>
> It seems that example #2 increases the grammar gap because the constraint
> expression can certainly not used on the RHS.
>
>
> <quote>
> As previously we had to document the restricted limitations of a field
> constraint on the LHS compared to expressions used inside of an 'eval' or
> used on the RHS.
>  </quote>
>
> I'm sorry, but I do not understand the meaning of this sentence. What does
> it mean, please?
>
> Cheers
> Wolfgang
>
>
>
> _______________________________________________
> 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/20110505/ebf9fbb9/attachment.html 


More information about the rules-dev mailing list