[rules-users] Any suggestions to implement exclusions and avoid update
Wishing Carebear
wishing.carebear at gmail.com
Tue Jul 12 08:32:46 EDT 2011
Hello,
Any pointers is greatly appreciated.
Thanks
On Monday, July 11, 2011, Wishing Carebear <wishing.carebear at 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 >= 20000, price <= 45000, highTheftProbabilty == Boolean.FALSE ) from $policy.vehicle
> then modify ($car) { setPotentialTheftRating( potentialTheftRatingType.MODERATE )
> } update($client);end
>
More information about the rules-users
mailing list