We are using Drools-3.0.6. In one of our scenarios, we are trying to use the OR
operator as follows:
rule Testing
when
person : (Person (interests contains "Golf") or Person (interests
contains "Soccer") )
then
System.out.println("I am interested");
end
Based on one of my earlier posts in this forum (long time back), this rule
will result in
"The OR CE will cause subrule generation, meaning the rule will fire twice if
both conditions are true".
One of the ways, i was planning to change this is as follows:
rule Testing
when
person : Person()
then
if (person.getInterests().contains("Golf") ||
person.getInterests().contains("Soccer")) {
System.out.println("I am interested");
}
end
I don't think this is the best solution, though. Anyone has any better ways
of implementing this? I know that Drools - 4 has a better support for this, but
right now we don't have plans of migrating.
Thank you.
regards,
-Jaikiran
---------------------------------
Did you know? You can CHAT without downloading messenger. Click here_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users