[rules-users] condition problem with multiple composite constraints connectives

Trägenap traegenap at ttc-informatik.de
Mon Dec 22 06:44:35 EST 2008


Hi,

I have Object of type Customer with int "field1, field2" and boolean 
"processed". (Example values field1 = 10, field2 = 180, not processed )

First, the condition in rule #1 was something like that:

$customer : Customer (field1 ( ( > 0 && > field2) || < 0) && processed 
== false)

... but it doesnt work properly. So I changed it to

rule "Rule #1"
     salience 46
     when
         $customer: Customer ( ( ( field1 < 0 ) || ( (field1 > 0) && 
(field1 > field2) )  ) && processed == false)
     then
         // do it
     // set customer to processed
end

rule "Rule #2"
     salience 45
     when
         $customer : Customer (field1 ( > 0 && < field2) && processed == 
false)
     then
     // do it
     // set customer to processed
end

The result is that both rules fired, both rules invokes "do it".

Maybe somebody can put some helpfull ideas under my christmas tree.

Thanks

Thorsten Trägenap











More information about the rules-users mailing list