[rules-users] "Trying to create a restriction for an empty restriction" error

Yuri ydewit at gmail.com
Wed Jul 25 16:04:52 EDT 2007


I am migrating my 3.0.6 rules into 4.0 but I am getting the following error in
Drools IDE:

"Trying to create a restriction for an empty restriction"

I am basically using an inline-eval (I believe this is the new terminology for
the ->() construct):

Rule
when
   c1:Child()
   c2:Child( 
      age -> (Math.abs(age - c1.age) < 10),
      ...)
then
   ...
end

If I remove the "age -> ..." line the error goes away.

Along the same lines I am also wondering if there is a better way (aside from
using "->()", which has a lower perf as I understand it) of doing the following:

Rule
when
   p1: Person()
   p2: Person(
         ...,
         sex -> ( 
            (sex == "M" && p1.sex == "F") 
            || (sex == "F" && p1.sex == "M") 
         )
   )
then
   insert(new Couple(p1, p2));
end

thanks,




More information about the rules-users mailing list