I assume, the OP has a bunch of rules that validate Addresses.<br><br>The Addresses could be on TaxPayer, NonTaxPayer, Payee, Employee etc etc.<br><br>I also assume the OP did not want to repeat the Address validation in rules containing the source of the Address.<br>
<br>As with all assumptions I might be wrong :)<br><br>Perhaps the OP can provide more detail.<br><br><div class="gmail_quote">On 5 September 2012 10:05, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Why not use<br>
<br>
when<br>
TaxPayer( $addrList : addressList )<br>
Address( zipCode == null) from $addrList<br>
then<br>
// report missing zip code because: if it is null, it is not<br>
invalid - just missing ;-)<br>
end<br>
<span class="HOEnZb"><font color="#888888"><br>
-W<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 05/09/2012, Michael Anstis <<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>> wrote:<br>
> If your rules look something like this:-<br>
><br>
> when<br>
> Address( zipCode == null )<br>
> then<br>
> //Report an invalid zipCode<br>
> end<br>
><br>
> You will need to extract the Address from the TaxPayer:-<br>
><br>
> when<br>
> TaxPayer( $a : address )<br>
> then<br>
> insert( $a );<br>
> end<br>
><br>
> You will need to consider how to correlate the Address with the TaxPayer<br>
> (to know which TaxPayer has an invalid Address).<br>
><br>
> On 5 September 2012 09:50, Suvek <<a href="mailto:suvek.shah@gmail.com">suvek.shah@gmail.com</a>> wrote:<br>
><br>
>> Hi,<br>
>><br>
>> I have set of rules defined for Address validation.<br>
>> How do I reuse these rules when the Taxpayer object is passed in as fact<br>
>> which contains Address as one of the field (list to be precise)?<br>
>> Do I somehow need to extract and add addresses to working memory within<br>
>> the<br>
>> drl file?<br>
>><br>
>> thanks<br>
>> S.<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> View this message in context:<br>
>> <a href="http://drools.46999.n3.nabble.com/Re-usability-of-rules-tp4019580.html" target="_blank">http://drools.46999.n3.nabble.com/Re-usability-of-rules-tp4019580.html</a><br>
>> Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
><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>
</div></div></blockquote></div><br>