[rules-users] Subclasses matche superclasses problem.

nicolae oana oananicolae1981 at yahoo.com
Fri Feb 16 05:10:53 EST 2007


Hi everybody,

I have a class Car which is superclass for class ConvertibleCar, two rules (described below) and a ConvertibleCar fact in working memory that causes both rules to fire, resulting this way an unwanted change to the car`s attribute and an infinite loop. 

How do I evitate this problem: the specialization class fact to not match its superclass column in a rule? 

ConvertibleCar car =new ConvertibleCar(10000);

rule "rule-1"
    when 
        $car:Convertible()
    then
   $car.setPotentialTheftRating("high");
end

rule "rule-2"
     when 
         $car:Car(price<20000)
     then
    $car.setPotentialTheftRating("low");
 end

Best regards, Oana



 
---------------------------------
The fish are biting.
 Get more visitors on your site using Yahoo! Search Marketing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070216/04cd21ae/attachment.html 


More information about the rules-users mailing list