[rules-users] Collections of Collections

Wolfgang Laun wolfgang.laun at gmail.com
Sun Oct 25 08:25:43 EDT 2009


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 at 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 at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091025/a2401f7a/attachment.html 


More information about the rules-users mailing list