The follow would actually generate three rules - called sub rules:
Person(sex == "f", age == 60) ||
Person(sex == "f", age == 70) ||
Person(sex == "f", age == 80)
Each rule is able to activate and fire, all three sub rules can
beactivated and fire at the same time - there is no short cutting.
The following would be a single rule:
Person(sex == "f", age == 60 || age == 70 || age == 80)
The || conditions would be embedded in a single alpha node - effectively
providing short cutting.
We currently do the first - we don't do the second, hopefully it will be in
3.1
Mark
Sunshine Joshua wrote:
I'm sorry Mark I don't understand what you wrote.
What are you referring to when you write 'the first', 'the second'?
-----Original Message-----
From: Mark Proctor [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 04, 2006 5:11 PM
To: user@drools.codehaus.org
Subject: Re: [drools-user] DRL design of OR conditions
in 3.1 we aim to allow age == 60 || age == 70 || age == 80
However the functionality will be different compared to condition 'or'.
The first will create sub rules for all logical outcomes. The above
notation creates a single rule and embeds that or logic in a an alpha
node. I guess the different is the first doesn't short cut, the second
does.
Mark
Christopher G. Stach II wrote:
I was wondering what the reasoning was behind DRLs requiring syntax
like
this:
Person(sex == "f", age == 60) ||
Person(sex == "f", age == 70) ||
Person(sex == "f", age == 80)
instead of like this:
Person(sex == "f", age == 60 || age == 70 || age == 80)
or even like this:
Person(sex == "f", age IN ( 60, 70, 80 ))