What about setting the field to 0 in the constructor of Salary?<br>Or using float (not java.lang.Float)?<br>-W<br><br><div class="gmail_quote">2009/5/13 Shabbir Dhari <span dir="ltr">&lt;<a href="mailto:sdhari@hotmail.com">sdhari@hotmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



<div>


<p>I know this
work around. But I have more than 50 rules using that attribute and it looks
very ugly to put null on every rule and its not single attribute. There are
more than 30 attributes in the bean and using them in LHS. Any other sophisticated
way?</p>

<br>&gt; Date: Tue, 12 May 2009 23:15:54 -0700<br>&gt; From: <a href="mailto:greg_barton@yahoo.com" target="_blank">greg_barton@yahoo.com</a><br>&gt; Subject: Re: [rules-users] NullPointerException with Wrapper objects<div class="im">
<br>&gt; To: <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>&gt; <br>&gt; <br></div><div class="im">&gt; All conditions of all applicable rules are evaluated when you insert an object into working memory.  This decides which rule actions can go on the agenda.  Only when a rule action is on the agenda is the salience used to determine the order of action firing.  So doing the null check in the way you&#39;re doing it will not work.<br>
&gt; <br>&gt; You must put the null check in the same rule, before the potentially null property is used.<br>&gt; <br>&gt; rule &quot;Nett Salary&quot; salience 70<br>&gt;   when<br>&gt;     Salary ( loanDeduction != null, nett != ( gross – loanDeduction – pf) )<br>
&gt;   then<br>&gt;     log(&quot;Invalid nett salary amount&quot;);<br>&gt; end<br>&gt; <br><br><br></div><hr>Check out the new Windows Live Messenger <a href="http://windowslive.ninemsn.com.au/article.aspx?id=792335" target="_blank">Looking for a fresh way to share your photos?</a></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>