Sounds like a plan :)<br><br><div class="gmail_quote">On 5 September 2012 10:43, 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">
<div class="im">On 05/09/2012, Michael Anstis <<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>> wrote:<br>
</div><div class="im">> 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>
</div>This would require rules for extracting Address(es) from NonTaxPayer,<br>
<div class="im">Payee, Employee etc etc.<br>
<br>
<br>
><br>
> I also assume the OP did not want to repeat the Address validation in rules<br>
> containing the source of the Address.<br>
<br>
</div>In that case, all the -ayers and ayees should have a common interface,<br>
e.g., Addressable and then you have one rule to fix them all.<br>
<span class="HOEnZb"><font color="#888888"><br>
-W<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> As with all assumptions I might be wrong :)<br>
><br>
> Perhaps the OP can provide more detail.<br>
><br>
> On 5 September 2012 10:05, Wolfgang Laun <<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>> wrote:<br>
><br>
>> 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>
>><br>
>> -W<br>
>><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<br>
>> > 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<br>
>> >> 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<br>
>> >> 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>
>><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>