[rules-users] "Or" and Collect
Dirk Bergstrom
dirk at juniper.net
Tue May 29 18:49:58 EDT 2007
In my ongoing efforts to abuse Drools syntax, I would like to write rules like this:
rule "severe bugs for which a member of your group is dev or support owner"
when
$group : UserGroup( )
$badBugs : List() from
collect( Bug( (devOwner memberOf $group or supportOwner memberOf $group),
severity == "hair-on-fire" )
then
$group.runAroundInStarkRavingPanicOver($badBugs)
end
Will that work? Is that the right syntax? Will it be performant if I've got
10000 Bugs and 1000 UserGroups?
According to Mark's "What's New in JBoss Rules 4.0" presentation, you can use &&
and || without subrule generation, and I have a vague memory of seeing something
about "and" & "or" as well, but I can't remember where I saw it.
Thanks.
--
Dirk Bergstrom dirk at juniper.net
_____________________________________________
Juniper Networks Inc., Computer Geek
Tel: 408.745.3182 Fax: 408.745.8905
More information about the rules-users
mailing list