Re: [rules-users] Any suggestions to implement exclusions and avoid update

2011-07-12 Thread Wishing Carebear
Hello,
Any pointers is greatly appreciated.

Thanks

On Monday, July 11, 2011, Wishing Carebear wishing.careb...@gmail.com wrote:
 Hi,
 Below are 2 rules, rule1 has higher precedence than rule2. Rule2 should not 
 execute if Rule 1 executes.
 1) One way to get this working is to check the null value.
 2) If the update is not called, the Rule2 gets executed using the previous 
 null value of potentialTheftRating.

 Is there any other way to implement this requirement.



 rule  Rule 1 PotentialTheft0    ruleflow-group TheftRating0
     salience 10    no-loop    lock-on-active
     when        $client : Client()        $policy : Service(productType == 
 Vehicle Insurance) from $client.service
         $car : Vehicle(potentialTheftRating == null, vehicleType == 
 vehicleTypeType.CAR, convertible == Boolean.TRUE) from $policy.vehicle    then
         modify ($car) {            setPotentialTheftRating(  
 potentialTheftRatingType.HIGH )
         }        update($client);end
     rule  Rule2 PotentialTheft0    ruleflow-group TheftRating0
     no-loop    lock-on-active    when
         $client : Client()        $policy : Service(productType == Vehicle 
 Insurance) from $client.service
         $car : Vehicle(potentialTheftRating == null,vehicleType == 
 vehicleTypeType.CAR, price = 2, price = 45000, highTheftProbabilty == 
 Boolean.FALSE ) from $policy.vehicle
     then        modify ($car) {            setPotentialTheftRating( 
 potentialTheftRatingType.MODERATE )
         }        update($client);end


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Any suggestions to implement exclusions and avoid update

2011-07-11 Thread Wishing Carebear
Hi,
Below are 2 rules, rule1 has higher precedence than rule2. Rule2 should not
execute if Rule 1 executes.
1) One way to get this working is to check the null value.
2) If the update is not called, the Rule2 gets executed using the previous
null value of potentialTheftRating.

Is there any other way to implement this requirement.



rule  Rule 1 PotentialTheft0
ruleflow-group TheftRating0
salience 10
no-loop
lock-on-active
when
$client : Client()
$policy : Service(productType == Vehicle Insurance) from
$client.service
$car : Vehicle(potentialTheftRating == null, vehicleType ==
vehicleTypeType.CAR, convertible == Boolean.TRUE) from $policy.vehicle
then
modify ($car) {
setPotentialTheftRating(  potentialTheftRatingType.HIGH )
}
update($client);
end

rule  Rule2 PotentialTheft0
ruleflow-group TheftRating0
no-loop
lock-on-active
when
$client : Client()
$policy : Service(productType == Vehicle Insurance) from
$client.service
$car : Vehicle(potentialTheftRating == null,vehicleType ==
vehicleTypeType.CAR, price = 2, price = 45000, highTheftProbabilty ==
Boolean.FALSE ) from $policy.vehicle
then
modify ($car) {
setPotentialTheftRating( potentialTheftRatingType.MODERATE )
}
update($client);
end
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users