[rules-users] Cutom Attributes in Drools

dme1 mehtad at hotmail.com
Fri Sep 14 10:08:09 EDT 2012


Thanks Davide.

Regarding "Multiple LHS and RHS.....", this comment refers to the need for
Custom Attributes,and is not related to Overriding Rules. To elaborate I was
looking for a way for the Rules to fire when some Attributes are set
(multiple LHS) as well as for the rule set some attributes if/when fired
(multiple RHS), and you and others have satisfactorily answered with the
options available with Drools (including Metadata) which will allow me to
achieve this (albeit with some limitations).

Regarding Overridden Rules - We have scenarios where we need the Rule to
behave differently for lets say a specific customer or a specific territory.
These rules could be rules that validate conditions, or rules that calculate
values. 

A simple example could be 

Default Common Rule:
when 
  p : Person (age >= 25)
then
  p.setPolicyType("Premium");

A rule that overrides this would be lets say for Region X:
when
  p : Person (age >= 25)
then
 p.setPolicyType("Extensive");

In theory this can be done using a check for Region "X" within another rule.
However we have a rule-flow where this rule would be part of the flow, as
well as multiple rules within the flow, which depend on the result of the
value from this rule. SO rather than having a separate flow for each region
we would like to have a common flow, and the rule fired should depend on if
there is an overridden rule for the Region, if not use the default rule.

Ideally I would like to create a separate Project/Package in Guvnor for the
Region since we have enough differences, and for rules to be overridden
across packages, but this I don't think will be possible in Drools as I did
not see a way of specifying package dependencies and using rule flow define
in one package in another package.

Hope this provides a good use case for what we are trying to achieve.

Thanks,
dme




--
View this message in context: http://drools.46999.n3.nabble.com/Cutom-Attributes-in-Drools-tp4019692p4019786.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list