<DIV style="font-family:Verdana, sans-serif; font-size:10pt;"><DIV>Hi all,</DIV>
<DIV> </DIV>
<DIV>I have doubt regarding the following rules:</DIV>
<DIV> </DIV><B><FONT color="#960000" size="2">
<P align="left">rule</P></FONT></B><FONT size="2"> </FONT><FONT color="#008000" size="2">"A Rule"</FONT></DIV><FONT size="2">
<P align="left"></P></FONT><B><FONT color="#960000" size="2"> when</FONT></B><FONT size="2">
<P align="left"></P></FONT><B><FONT color="#960000" size="2"> not</FONT></B><FONT size="2"> LoanBean();
<P align="left"></P></FONT><B><FONT color="#960000" size="2"> then</FONT></B><FONT size="2">
<P align="left"> LoanBean loan = </P></FONT><B><FONT color="#960000" size="2">new</FONT></B><FONT size="2"> LoanBean();
<P align="left"> loan.setLoanId(</P></FONT><FONT color="#008000" size="2">"1"</FONT><FONT size="2">);
<P align="left"> System.out.println(</P></FONT><FONT color="#008000" size="2">"A rule"</FONT><FONT size="2">);
<P align="left"> loan.setLoanId(</P></FONT><FONT color="#008000" size="2">"1"</FONT><FONT size="2">);
<P align="left"></P></FONT><B><FONT color="#960000" size="2"> assertLogical</FONT></B><FONT size="2">(loan);</FONT><B><FONT color="#960000" size="2">
<P align="left">end</P></FONT></B><FONT size="2">
<P align="left"></P></FONT><B><FONT color="#960000" size="2">
<P align="left">
</P><P align="left">rule</P></FONT></B><FONT size="2"> </FONT><FONT color="#008000" size="2">"B Rule"</FONT><FONT size="2">
<P align="left"></P></FONT><B><FONT color="#960000" size="2"> when</FONT></B><FONT size="2">
<P align="left"> a:LoanBean(loanId == </P></FONT><FONT color="#008000" size="2">"1"</FONT><FONT size="2">);
<P align="left"></P></FONT><B><FONT color="#960000" size="2"> then</FONT></B><FONT size="2">
<P align="left"> System.out.println(</P></FONT><FONT color="#008000" size="2">"B Rule"</FONT><FONT size="2">);</FONT><FONT color="#960000" size="2">
<P align="left"><STRONG>end</STRONG>
</P><P align="left">
</P><P align="left">In the above examples, if I am using assert(loan), then it is printing as "A Rule" and "B Rule". But when I have used assertLogical(loan), then "A Rule" is printing continously, without "B Rule" printing. Why?
</P><P align="left">
</P><P align="left">And also I am able to use Global variable for loan(LoanBean loan). I have setGlobal in the workingMemory. The same thing If I used like below using global, I am getting the NullPointer Exception. I have set
</P><P align="left">
</P><P align="left">global LoanBean loan;
</P><P align="left"><STRONG> </STRONG>
</P><P align="left"><STRONG>rule</STRONG><FONT color="#000000" size="2"> </FONT><FONT color="#008000" size="2">"A Rule"</FONT><FONT size="2">
<P align="left"></P></FONT><FONT color="#960000" size="2"><STRONG> when</STRONG></FONT><FONT size="2">
<P align="left"></P></FONT><FONT color="#960000" size="2"><STRONG> not</STRONG></FONT><FONT size="2"><STRONG> LoanBean();</STRONG>
<P align="left"></P></FONT><FONT color="#960000" size="2"><STRONG> then</STRONG></FONT><FONT size="2">
<P align="left"><STRONG> loan = </STRONG></P></FONT><FONT color="#960000" size="2"><STRONG>new</STRONG></FONT><FONT size="2"><STRONG> LoanBean();</STRONG>
<P align="left"><STRONG> loan.setLoanId(</STRONG></P></FONT><FONT color="#008000" size="2"><STRONG>"1"</STRONG></FONT><FONT size="2"><STRONG>); //</STRONG> Why In IDE, setLoanId() is not coming if the loan is the global, but if it's<STRONG> </STRONG></FONT>
</P><P align="left"><FONT size="2"> local like LoanBean loan = new LoanBean(), then all the properties are </FONT>
</P><P align="left"><FONT size="2"> displaying
<P align="left"><STRONG> System.out.println(</STRONG></P></FONT><FONT color="#008000" size="2"><STRONG>"A rule"</STRONG></FONT><FONT size="2"><STRONG>);</STRONG>
<P align="left"><STRONG> loan.setLoanId(</STRONG></P></FONT><FONT color="#008000" size="2"><STRONG>"1"</STRONG></FONT><FONT size="2"><STRONG>);</STRONG>
<P align="left"></P></FONT><STRONG><FONT color="#960000" size="2"> assertLogical</FONT><FONT size="2">(loan);</FONT></STRONG><FONT color="#960000" size="2">
<P align="left"><STRONG>end</STRONG></P></FONT><FONT size="2">
<P align="left"></P></FONT><FONT color="#960000" size="2">
<P align="left">
</P><P align="left"><STRONG>rule</STRONG></P></FONT><FONT color="#000000" size="2"> </FONT><FONT color="#008000" size="2">"B Rule"</FONT><FONT size="2">
<P align="left"></P></FONT><FONT color="#960000" size="2"><STRONG> when</STRONG></FONT><FONT size="2">
<P align="left"><STRONG> a:LoanBean(loanId == </STRONG></P></FONT><FONT color="#008000" size="2"><STRONG>"1"</STRONG></FONT><FONT size="2"><STRONG>);</STRONG>
<P align="left"></P></FONT><FONT color="#960000" size="2"><STRONG> then</STRONG></FONT><FONT size="2">
<P align="left"><STRONG> System.out.println(</STRONG></P></FONT><STRONG><FONT color="#008000" size="2">"B Rule"</FONT><FONT size="2">);</FONT></STRONG><FONT color="#960000" size="2">
<P align="left"><STRONG>end</STRONG></P></FONT>
</P><P align="left">
</P><P align="left">Regards,
</P><P align="left">Micheal john</P></FONT><BR> <BR><HR>Get email for your site ---> http://www.everyone.net