Vincent has answered this very well. I'd just like to point out that
you might read a verbal interpretation of the conditions to yourself,
and judge for yourself.
(a) When there is a RuleContect where the billingSystem equals "ABC"
and there is a RuleContext where the policyStatus is equals "active"
and there is a RuleContext where a renewalDueDate is given then...
(b) When there is a RuleContect where the billingSystem equals "ABC"
and the policyStatus is equals "active" and a renewalDueDate is given
then...
-W
On 18/04/2012, larryc <larry.chambers(a)sentry.com> wrote:
I was reviewing some of our DRLs and noticed some rules written like
this:
when
RuleContext(billingSystem == "ABC")
RuleContext(policyStatus == "active")
RuleContext(renewalDueDate != null)
then ...
while others were written this way:
when
RuleContext(billingSystem == "ABC", policyStatus == "active",
renewalDueDate != null)
then ...
There should only be one RuleContext fact in the knowledge base at one time.
Which approach is better? Is one approach more efficient for Drools than
the other? Does it matter?
Thanks!
--
View this message in context:
http://drools.46999.n3.nabble.com/Best-way-to-write-a-rule-where-pattern-...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users