u almost had it. This should do it.<br>&nbsp;<br>Subscriber($age : age)<br>Campaign($campaignAgeRangs : listOfAgeRangeCodes)<br>
AgeRange(minAge &lt;= $age, max &gt;= $age, code memberOf $campaignAgeRangs)<br><br>As far as performance, i would think the former would be faster. This
one will look at all campaigns regardless if they have an AgeRange that
matches. The former just looks for an AgeRange, then joins back to the
Campaign.<br><br>dave<br><br><div class="gmail_quote">On Sun, Dec 21, 2008 at 2:18 PM, Maxim Veksler <span dir="ltr">&lt;<a href="mailto:maxim.veksler@gmail.com">maxim.veksler@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Thank you very much for the fast and accurate reply David,<br><br><br>Is it also possible to use the opposite positioning?, something like:<br><br>Subscriber($age : age)<br>Campaign($campaignAgeRangs : listOfAgeRangeCodes)<br>

AgeRange(minAge &lt;= $age, max &gt;= $age, $campaignAgeRangs contains code)<br><br><br>Please don&#39;t try the above as this tries to create a field extractor for $campaignAgeRangs on the AgeRange object which fails for obvious reasons..<br>

<br>I would like to to filter first by Subscriber, then by Campaign and last by age range. This is obviously a simplification of the actual filtering rules.<div><div></div><div class="Wj3C7c"><br><br><br><div class="gmail_quote">
On Sun, Dec 21, 2008 at 7:28 PM, David Sinclair <span dir="ltr">&lt;<a href="mailto:dsinclair@chariotsolutions.com" target="_blank">dsinclair@chariotsolutions.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Subscriber($age : age)<br>AgeRange(minAge &lt;= $age, max &gt;= $age, $code : code)<br>Campaign(listOfAgeRangeCodes contains $code)<br>

<br><div class="gmail_quote"><div><div></div><div>On Sun, Dec 21, 2008 at 12:17 PM, Maxim Veksler <span dir="ltr">&lt;<a href="mailto:maxim.veksler@gmail.com" target="_blank">maxim.veksler@gmail.com</a>&gt;</span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div><div dir="ltr">Hello,<br><br><br>The dataModel is as following:<br>

<br>class AgeRange() {<br>
Integer code;<br>int minAge;<br>int maxAge;<br>}<br><br>Campaign() {<br>List&lt;Integer&gt; listOfAgeRangeCodes;<br>}<br><br>Subscriber() {<br>
int age;<br>}<br><br>AgeRange()&#39;s and Campaign()&#39;s are pre-populated into the WM.<br>Subscriber() is asserted right before fireAllRules is called.<br><br>I need a rule that would allow me to check if Subscriber() is within one of the defined on the Campaign() AgeRange()&#39;s.<br>



<br>What would be the most efficient way to enforce this constraint? <br>The other possibility I see is to store the list of AgeRange()&#39;s in each Campaign() and then use eval() to iterate over the list...<br><br><br>


Advice and ideas are appreciated.<br>
<br><br>Thank you,<br>Maxim.<br>-- <br>Cheers, <br>Maxim Veksler<br><br>&quot;Free as in Freedom&quot; - Do u GNU ?<br>
</div>
<br></div></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Cheers, <br>Maxim Veksler<br><br>&quot;Free as in Freedom&quot; - Do u GNU ?<br>
</div></div></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>