<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; COLOR: #444444; LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Segoe UI'">Well I cant explain you all the issues and requirements here. Simply&nbsp;we dont have provision to do so. We have to check the null in the&nbsp;rules and log the message plus other evaluation and arithmetic.</SPAN><BR>&nbsp;</P>
<HR id=stopSpelling>
Date: Wed, 13 May 2009 10:36:59 +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>But you do control the insertion of your facts. Rather than cluttering rules with conditions dealing with irregular values, preprocess the object. And you should be able to log from there, just as well.<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 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>
Date: Wed, 13 May 2009 09:01:05 +0200
<DIV class=EC_im><BR>Subject: Re: [rules-users] NullPointerException with Wrapper objects<BR></DIV>From: <A href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</A>
<DIV class=EC_im><BR>To: <A href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</A><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>2009/5/13 Shabbir Dhari <SPAN dir=ltr>&lt;<A href="mailto:sdhari@hotmail.com">sdhari@hotmail.com</A>&gt;</SPAN><BR>
<BLOCKQUOTE 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><BR>&gt; To: <A href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</A><BR>&gt; <BR>&gt; <BR></DIV>
<DIV>&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></DIV>
<HR>
Click Here <A href="http://a.ninemsn.com.au/b.aspx?URL=http://dating.ninemsn.com.au/search/search.aspx?exec%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&amp;_t=773166090&amp;_r=Hotmail_Endtext&amp;_m=EXT">View photos of singles in your area</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 />Find out how with Windows Live! <a href='http://windowslive.ninemsn.com.au/' target='_new'>Want to stay on top of your life online?</a></body>
</html>