<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
I can not initialize property as need to log the message. The bean comes from outside&nbsp;our application scope. We do not have control to make them menodatory. And we need to log the message. You mean there&nbsp;is no solution&nbsp;of this problem? And remember my second rule does not compare propery but it&nbsp;performs some calculations.&nbsp;<BR>&nbsp;<BR>
<HR id=stopSpelling>
Date: Wed, 13 May 2009 09:01:05 +0200<BR>Subject: Re: [rules-users] NullPointerException with Wrapper objects<BR>From: wolfgang.laun@gmail.com<BR>To: rules-users@lists.jboss.org<BR><BR>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=EC_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=EC_gmail_quote style="PADDING-LEFT: 1ex">
<DIV>
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?<BR><BR>&gt; Date: Tue, 12 May 2009 23:15:54 -0700<BR>&gt; From: <A href="mailto:greg_barton@yahoo.com">greg_barton@yahoo.com</A><BR>&gt; Subject: Re: [rules-users] NullPointerException with Wrapper objects
<DIV class=EC_im><BR>&gt; To: <A href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</A><BR>&gt; <BR>&gt; <BR></DIV>
<DIV class=EC_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'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 "Nett Salary" salience 70<BR>&gt; when<BR>&gt; Salary ( loanDeduction != null, nett != ( gross – loanDeduction – pf) )<BR>&gt; then<BR>&gt; log("Invalid nett salary amount");<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">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">https://lists.jboss.org/mailman/listinfo/rules-users</A><BR><BR></BLOCKQUOTE></DIV><BR><br /><hr />Click Here <a href='http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fdating%2Eninemsn%2Ecom%2Eau%2Fsearch%2Fsearch%2Easpx%3Fexec%3Dgo%26tp%3Dq%26gc%3D2%26tr%3D1%26lage%3D18%26uage%3D55%26cl%3D14%26sl%3D0%26dist%3D50%26po%3D1%26do%3D2%26trackingid%3D1046138%26r2s%3D1&_t=773166090&_r=Hotmail_Endtext&_m=EXT' target='_new'>View photos of singles in your area</a></body>
</html>