Consider a staged approach:
One rule would find all counties with dealers and insert a (temporary) fact
for each, let's call them GoodCounty( County c ).
Another rule would match any GoodCounty and its wealthy Zips, obtained with
a from $goodCounty.getCounty().zips.
A third low salience rule would be required to get rid of all GoodCounty
temporaries.
-W
2009/10/22 Ken Archer <archerovi(a)hotmail.com>
There are certain domains where a collection of objects is itself a
member
of a different collection of objects (e.g. zips in counties in states,
persons in cars at intersections). In these domains, it would be helpful to
create LHS conditions on the individual members of the "subcollection". An
very hypothetical example of a rule that send direct mail to wealthy zip
codes in counties with dealers in states where a business is licensed.
WHEN
$ServiceableState: State (LicensedInState=True)
$CountiesWithDealers: County (DealersInCounty>0) from
$ServiceableState.counties
$WealthyZips: Zip (AvgIncome>$100,000) from $CountiesWithDealers.zips
//2nd from not allowed
THEN
$WealthyZips.SendDirectMail ()
I know Collect and Accumulate support nested From keywords, but can you
nest From keywords themselves to handle collections of collections?
Ken Archer
Telogical Systems
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users