<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">Hi Thomas<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN><BR>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">&nbsp;<o:p></o:p></SPAN><BR>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">Thanks your prompt reply. I am sure all three attributes are NOT null. I have tested them before sending question to mailing list. If you want, I&nbsp;can send complete sample code and you can try it at your end.<o:p></o:p></SPAN><BR>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">&nbsp;<o:p></o:p></SPAN><BR>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">Regards,<o:p></o:p></SPAN><BR>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Verdana','sans-serif'">Dhari<o:p></o:p></SPAN><BR>
<BR>&nbsp;<BR>
<HR id=stopSpelling>
Date: Tue, 23 Feb 2010 02:50:08 -0800<BR>From: <a href="http://n3.nabble.com/user/SendEmail.jtp?type=node&node=383423&i=0" target="_top" rel="nofollow">[hidden email]</a><BR>To: <a href="http://n3.nabble.com/user/SendEmail.jtp?type=node&node=383423&i=1" target="_top" rel="nofollow">[hidden email]</a><BR>Subject: Re: Comparing Date with || OR operator<BR><BR>


<DIV class=ecxSection1>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">If it works fine with an and operator then I’d imagine that startDate &lt; $regDate returns false, with an &amp;&amp; this would abort evaluation immediately but with an or it would mean that startDate &gt; endDate is evaluated and so presumably it is this bit that is throwing the NPE.&nbsp; I’d imagine that the most likely reason for this would be that endDate is null.</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">&nbsp;</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Try changing it too </SPAN></P><PRE>Segment ( startDate &lt; $regDate || (endDate != null &amp;&amp; startDate &gt; endDate) )</PRE>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">And see whether you loose the NPE.</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">&nbsp;</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Thomas</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">&nbsp;</SPAN></P>
<DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: blue 1.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none">
<DIV>
<DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=ecxMsoNormal><B><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> <A rel="nofollow" target="_top" link="external">[hidden email]</A> [mailto:<A rel="nofollow" target="_top" link="external">[hidden email]</A>] <B>On Behalf Of </B>dhari<BR><B>Sent:</B> 23 February 2010 06:15<BR><B>To:</B> <A rel="nofollow" target="_top" link="external">[hidden email]</A><BR><B>Subject:</B> [rules-users] Comparing Date with || OR operator</SPAN></P></DIV></DIV>
<P class=ecxMsoNormal>&nbsp;</P>
<P class=ecxMsoNormal>The following code generates NPE in ReteTuple.java </P><PRE>rule </PRE><PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when</PRE><PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Membership ( $regDate : regDate)</PRE><PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Segment ( startDate &lt; $regDate || startDate &gt; endDate )</PRE><PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then</PRE><PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; System.err.print(“Invalid start date”);</PRE><PRE>end</PRE>
<P class=ecxMsoNormal>I am new in Drools and don’t know much about DRL scripting. It works fine I use &amp;&amp; operator instead. </P>
<DIV class=ecxMsoNormal>
<HR style="WIDTH: 225pt" align=left width=300 SIZE=2>
</DIV>
<P class=ecxMsoNormal>View this message in context: <A rel="nofollow" target="_top" link="external">Comparing Date with || OR operator</A><BR>Sent from the <A rel="nofollow" target="_top" link="external">Drools - User mailing list archive</A> at Nabble.com.</P></DIV></DIV><BR>
<HR>
<FONT face=Arial color=gray size=1><BR>**************************************************************************************<BR>This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the <A rel="nofollow" target="_top" link="external">[hidden email]</A> and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.<BR><BR>NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00<BR>**************************************************************************************<BR></FONT><BR>
<HR>
<FONT face=Arial color=gray size=1>This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the <A rel="nofollow" target="_top" link="external">[hidden email]</A> and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes.<BR>To protect the environment please do not print this e-mail unless necessary.<BR><BR>An NDS Group Limited company. www.nds.com<BR></FONT><BR>_______________________________________________ <BR>rules-users mailing list <BR><A rel="nofollow" target="_top" link="external">[hidden email]</A> <BR><A rel="nofollow" target="_top" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</A><BR><BR><BR>
<HR color=#cccccc SIZE=1>

<DIV style="FONT: 11px tahoma,geneva,helvetica,arial,sans-serif; COLOR: #666666">View message @ <A target="_top" rel="nofollow" link="external">http://n3.nabble.com/Comparing-Date-with-OR-operator-tp347656p379447.html</A> <BR>To unsubscribe from Drools - Java Rules Engine, <A target="_top" rel="nofollow" link="external">click here</A>. </DIV><BR>                                               <br /><hr />Find your next place with Ninemsn property <a href='http://clk.atdmt.com/NMN/go/157631292/direct/01/' target='_new' rel="nofollow" link="external">Looking for a place to rent, share or buy?</a>

<br><hr align="left" width="300">
View this message in context: <a href="http://n3.nabble.com/Comparing-Date-with-OR-operator-tp347656p383423.html">RE: Comparing Date with || OR operator</a><br>
Sent from the <a href="http://n3.nabble.com/Drools-User-f47000.html">Drools - User mailing list archive</a> at Nabble.com.<br>