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">&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">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 &lt;<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>&gt; wrote:<br>
&gt; If your rules look something like this:-<br>
&gt;<br>
&gt; when<br>
&gt;     Address( zipCode == null )<br>
&gt; then<br>
&gt;     //Report an invalid zipCode<br>
&gt; end<br>
&gt;<br>
&gt; You will need to extract the Address from the TaxPayer:-<br>
&gt;<br>
&gt; when<br>
&gt;     TaxPayer( $a : address )<br>
&gt; then<br>
&gt;     insert( $a );<br>
&gt; end<br>
&gt;<br>
&gt; You will need to consider how to correlate the Address with the TaxPayer<br>
&gt; (to know which TaxPayer has an invalid Address).<br>
&gt;<br>
&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;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; I have set of rules defined for Address validation.<br>
&gt;&gt; How do I reuse these rules when the Taxpayer object is passed in as fact<br>
&gt;&gt; which contains Address as one of the field (list to be precise)?<br>
&gt;&gt; Do I somehow need to extract and add addresses to working memory within<br>
&gt;&gt; the<br>
&gt;&gt; drl file?<br>
&gt;&gt;<br>
&gt;&gt; thanks<br>
&gt;&gt; S.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&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; Sent from the Drools: User forum mailing list archive at Nabble.com.<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>