Sounds like a plan :)<br><br><div class="gmail_quote">On 5 September 2012 10:43, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</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 &lt;<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>&gt; wrote:<br>
</div><div class="im">&gt; I assume, the OP has a bunch of rules that validate Addresses.<br>
&gt;<br>
&gt; 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>
&gt;<br>
&gt; I also assume the OP did not want to repeat the Address validation in rules<br>
&gt; 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>
&gt;<br>
&gt; As with all assumptions I might be wrong :)<br>
&gt;<br>
&gt; Perhaps the OP can provide more detail.<br>
&gt;<br>
&gt; On 5 September 2012 10:05, Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Why not use<br>
&gt;&gt;<br>
&gt;&gt;   when<br>
&gt;&gt;      TaxPayer( $addrList : addressList )<br>
&gt;&gt;      Address( zipCode == null) from $addrList<br>
&gt;&gt;  then<br>
&gt;&gt;      // report missing zip code because: if it is null, it is not<br>
&gt;&gt; invalid - just missing ;-)<br>
&gt;&gt;  end<br>
&gt;&gt;<br>
&gt;&gt; -W<br>
&gt;&gt;<br>
&gt;&gt; On 05/09/2012, Michael Anstis &lt;<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; If your rules look something like this:-<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; when<br>
&gt;&gt; &gt;     Address( zipCode == null )<br>
&gt;&gt; &gt; then<br>
&gt;&gt; &gt;     //Report an invalid zipCode<br>
&gt;&gt; &gt; end<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; You will need to extract the Address from the TaxPayer:-<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; when<br>
&gt;&gt; &gt;     TaxPayer( $a : address )<br>
&gt;&gt; &gt; then<br>
&gt;&gt; &gt;     insert( $a );<br>
&gt;&gt; &gt; end<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; You will need to consider how to correlate the Address with the<br>
&gt;&gt; &gt; TaxPayer<br>
&gt;&gt; &gt; (to know which TaxPayer has an invalid Address).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On 5 September 2012 09:50, Suvek &lt;<a href="mailto:suvek.shah@gmail.com">suvek.shah@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; Hi,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I have set of rules defined for Address validation.<br>
&gt;&gt; &gt;&gt; How do I reuse these rules when the Taxpayer object is passed in as<br>
&gt;&gt; &gt;&gt; fact<br>
&gt;&gt; &gt;&gt; which contains Address as one of the field (list to be precise)?<br>
&gt;&gt; &gt;&gt; Do I somehow need to extract and add addresses to working memory<br>
&gt;&gt; &gt;&gt; within<br>
&gt;&gt; &gt;&gt; the<br>
&gt;&gt; &gt;&gt; drl file?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; thanks<br>
&gt;&gt; &gt;&gt; S.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; View this message in context:<br>
&gt;&gt; &gt;&gt; <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>
&gt;&gt; &gt;&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; rules-users mailing list<br>
&gt;&gt; &gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;<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>