[rules-users] Question on OR operator
Sarika Khamitkar
skhamitkar at risklabs.com
Mon Aug 13 13:14:09 EDT 2007
Hi,
I am currently using JBoss Rules 4.0 and need help with the OR operator.
The rules look similar to the following:
rule "rule1"
(Field (ID == 1, strValue matches "test") and Field (ID == 2,
lookupValue contains 7337 || lookupValue contains 3901) and Field (ID ==
3, dateValue >= "04-Jul-2000")) or (Field (ID == 4, strValue == "foo"))
then
System.out.println("rule fired");
end
The rules are constructed with data from UI and there can be multiple
nesting of OR and AND operators. As mentioned in the documentation and
earlier postings, the expected behavior is that this rule fires twice if
both the 1st and 2nd halves of the OR operator are true. As per our
requirement, the 2nd half of OR should be evaluated only if the 1st half
is false. So that way the rule can fire only once. I do not want to
retract the inserted objects as I want other rules to fire too. How can
I write this rule to get the required behavior?
Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070813/396b7acb/attachment.html
More information about the rules-users
mailing list