[rules-users] Best way to write a rule where pattern has multiple constraints

Wolfgang Laun wolfgang.laun at gmail.com
Wed Apr 18 13:48:50 EDT 2012


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 at 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-has-multiple-constraints-tp3920532p3920532.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list