[rules-users] Delimited Number groups filtering ?

David Sinclair dsinclair at chariotsolutions.com
Sun Dec 21 12:28:17 EST 2008


Subscriber($age : age)
AgeRange(minAge <= $age, max >= $age, $code : code)
Campaign(listOfAgeRangeCodes contains $code)

On Sun, Dec 21, 2008 at 12:17 PM, Maxim Veksler <maxim.veksler at gmail.com>wrote:

> Hello,
>
>
> The dataModel is as following:
>
> class AgeRange() {
> Integer code;
> int minAge;
> int maxAge;
> }
>
> Campaign() {
> List<Integer> listOfAgeRangeCodes;
> }
>
> Subscriber() {
> int age;
> }
>
> AgeRange()'s and Campaign()'s are pre-populated into the WM.
> Subscriber() is asserted right before fireAllRules is called.
>
> I need a rule that would allow me to check if Subscriber() is within one of
> the defined on the Campaign() AgeRange()'s.
>
> What would be the most efficient way to enforce this constraint?
> The other possibility I see is to store the list of AgeRange()'s in each
> Campaign() and then use eval() to iterate over the list...
>
>
> Advice and ideas are appreciated.
>
>
> Thank you,
> Maxim.
> --
> Cheers,
> Maxim Veksler
>
> "Free as in Freedom" - Do u GNU ?
>
> _______________________________________________
> 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/20081221/76b2fee7/attachment.html 


More information about the rules-users mailing list