[rules-users] PredicateConstraints and MVEL issue?

Yuri ydewit at gmail.com
Tue Sep 4 11:28:39 EDT 2007


Consider the following rules:

rule (1)
   when
      a: Criteria(
         $criteriaA : criteriaA,
         $criteriaB : criteriaB )

      b: Criteria(){
         matchCriteriaA == true && criteriaA == $criteriaA
            || matchCriteriaB == true && criteriaB == $criteriaB
      }
   then
      ...
end

rule (2)
   when
      a: Criteria(
         $criteriaA : criteriaA,
         $criteriaB : criteriaB )

      b: Criteria(){
         eval(
            matchCriteriaA == true && criteriaA == $criteriaA
               || matchCriteriaB == true && criteriaB == $criteriaB
         )
      }
   then
      ...
end

I am seeing different behavior for the same test cases. I am basically inserting
 "a" and "b" with matching criteriaA and criteriaB and I am testing different
combinations of matchCriteriaA and matchCriteriaB (i.e. F/F, F/T, T/F, T/T).

Results for rule (1):
F/F -> rule activated (incorrect)
T/F -> rule activated (correct)
F/T -> rule activated (correct)

Results for rule (2):
F/F -> rule activated (incorrect)
T/F -> rule activated (correct)
F/T -> rule activated (correct)

Any ideas?





More information about the rules-users mailing list