<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 10"><meta name="Originator" content="Microsoft Word 10"><link rel="File-List" href="file:///C:%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";
        mso-ansi-language:EN-US;
        mso-fareast-language:EN-US;}
p.OSRBodyText, li.OSRBodyText, div.OSRBodyText
        {mso-style-name:"OSR Body Text";
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:11.0pt;
        margin-left:0cm;
        mso-pagination:widow-orphan;
        font-size:11.0pt;
        mso-bidi-font-size:12.0pt;
        font-family:Arial;
        mso-fareast-font-family:"Times New Roman";
        mso-fareast-language:EN-US;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
        {mso-style-name:"Table Normal";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";}
</style>
<![endif]-->

<p class="OSRBodyText" style="">I tried
with some thing different and it worked but I don’t want this as I have many
collections in my data structure.</p>

<br>&nbsp;&nbsp;&nbsp; //this works<br>&nbsp; &nbsp; Membership ( $regDate : regDate)<br>&nbsp;&nbsp;&nbsp; Segment ( $endDate : endDate )<br>&nbsp;&nbsp;&nbsp; Segment ( startDate &lt; $regDate || startDate &gt; $endDate )<br><br>&nbsp;&nbsp;&nbsp; //this does NOT work<br>&nbsp;&nbsp;&nbsp; Membership ( $regDate : regDate)<br>&nbsp;&nbsp;&nbsp; Segment ($endDate : endDate, startDate &lt; $regDate || startDate &gt; $endDate )<br><br><hr id="stopSpelling">From: sdhari@hotmail.com<br>To: rules-users@lists.jboss.org<br>Date: Tue, 23 Feb 2010 23:09:50 +0000<br>Subject: Re: [rules-users] Comparing Date with || OR operator<br><br>



<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Verdana;}
</style>


Segment ( $endDate : endDate, startDate &lt; $regDate || startDate &gt; $endDate ) even does not work. I am using verstion 5.0.1. All dates are java.util.Date and values in sample fact are:<br><br>regDate = Fri Aug 01 00:00:00 BST 2008<br>startDate =&nbsp; Tue Sep 01 00:00:00 BST 2009<br>endDate = Fri Jul 30 00:00:00 BST 2010<br><br>Stack trace: <br><br>java.lang.NullPointerException<br>&nbsp;&nbsp;&nbsp; at org.drools.reteoo.LeftTuple.get(LeftTuple.java:265)<br>&nbsp;&nbsp;&nbsp; at org.drools.reteoo.LeftTuple.get(LeftTuple.java:300)<br>&nbsp;&nbsp;&nbsp; at org.drools.rule.VariableRestriction$ObjectVariableContextEntry.updateFromTuple(VariableRestriction.java:320)<br>&nbsp;&nbsp;&nbsp; at org.drools.rule.AbstractCompositeConstraint$MultiFieldConstraintContextEntry.updateFromTuple(AbstractCompositeConstraint.java:305)<br>&nbsp;&nbsp;&nbsp; at org.drools.common.SingleBetaConstraints.updateFromTuple(SingleBetaConstraints.java:119)<br>&nbsp;&nbsp;&nbsp; at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:109)<br>&nbsp;&nbsp;&nbsp; at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:117)<br>&nbsp;&nbsp;&nbsp; at org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:78)<br>&nbsp;&nbsp;&nbsp; at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:142)<br>&nbsp;&nbsp;&nbsp; at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)<br>&nbsp;&nbsp;&nbsp; at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)<br>&nbsp;&nbsp;&nbsp; at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:146)<br>&nbsp;&nbsp;&nbsp; at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1046)<br>&nbsp;&nbsp;&nbsp; at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1001)<br>&nbsp;&nbsp;&nbsp; at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:788)<br>&nbsp;&nbsp;&nbsp; at org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java:192)<br>&nbsp;&nbsp;&nbsp; at au.gov.nsw.osr.zena.rules.AnnualRulesTester.main(AnnualRulesTester.java:57)<br><br><br>&gt; Date: Tue, 23 Feb 2010 12:54:46 +0100<br>&gt; From: wolfgang.laun@gmail.com<br>&gt; To: rules-users@lists.jboss.org<br>&gt; Subject: Re: [rules-users] Comparing Date with || OR operator<br>&gt; <br>&gt; Please try this rewrite of the 2nd CE:<br>&gt;    Segment ( $endDate : endDate, startDate &lt; $regDate || startDate &gt; $endDate )<br>&gt; and report the outcome to the list, together with the Dools version<br>&gt; you are using.<br>&gt; Thank you.<br>&gt; <br>&gt; <br>&gt; 2010/2/23 dhari &lt;sdhari@hotmail.com&gt;:<br>&gt; &gt; Hi Thomas<br>&gt; &gt;<br>&gt; &gt; Thanks your prompt reply. I am sure all three attributes are NOT null. I<br>&gt; &gt; have tested them before sending question to mailing list. If you want, I&nbsp;can<br>&gt; &gt; send complete sample code and you can try it at your end.<br>&gt; &gt;<br>&gt; &gt; Regards,<br>&gt; &gt; Dhari<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt; Date: Tue, 23 Feb 2010 02:50:08 -0800<br>&gt; &gt; From: [hidden email]<br>&gt; &gt; To: [hidden email]<br>&gt; &gt; Subject: Re: Comparing Date with || OR operator<br>&gt; &gt;<br>&gt; &gt; If it works fine with an and operator then I’d imagine that startDate &lt;<br>&gt; &gt; $regDate returns false, with an &amp;&amp; this would abort evaluation immediately<br>&gt; &gt; but with an or it would mean that startDate &gt; endDate is evaluated and so<br>&gt; &gt; presumably it is this bit that is throwing the NPE.&nbsp; I’d imagine that the<br>&gt; &gt; most likely reason for this would be that endDate is null.<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Try changing it too<br>&gt; &gt;<br>&gt; &gt; Segment ( startDate &lt; $regDate || (endDate != null &amp;&amp; startDate &gt; endDate) )<br>&gt; &gt;<br>&gt; &gt; And see whether you loose the NPE.<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Thomas<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; From: [hidden email] [mailto:[hidden email]] On Behalf Of dhari<br>&gt; &gt; Sent: 23 February 2010 06:15<br>&gt; &gt; To: [hidden email]<br>&gt; &gt; Subject: [rules-users] Comparing Date with || OR operator<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; The following code generates NPE in ReteTuple.java<br>&gt; &gt;<br>&gt; &gt; rule<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; when<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Membership ( $regDate : regDate)<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Segment ( startDate &lt; $regDate || startDate &gt; endDate )<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; System.err.print(“Invalid start date”);<br>&gt; &gt;<br>&gt; &gt; end<br>&gt; &gt;<br>&gt; &gt; I am new in Drools and don’t know much about DRL scripting. It works fine I<br>&gt; &gt; use &amp;&amp; operator instead.<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt;<br>&gt; &gt; View this message in context: Comparing Date with || OR operator<br>&gt; &gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt; **************************************************************************************<br>&gt; &gt; This message is confidential and intended only for the addressee. If you<br>&gt; &gt; have received this message in error, please immediately notify the [hidden<br>&gt; &gt; email] and delete it from your system as well as any copies. The content of<br>&gt; &gt; e-mails as well as traffic data may be monitored by NDS for employment and<br>&gt; &gt; security purposes. To protect the environment please do not print this<br>&gt; &gt; e-mail unless necessary.<br>&gt; &gt;<br>&gt; &gt; NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18<br>&gt; &gt; 4EX, United Kingdom. A company registered in England and Wales. Registered<br>&gt; &gt; no. 3080780. VAT no. GB 603 8808 40-00<br>&gt; &gt; **************************************************************************************<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt; This message is confidential and intended only for the addressee. If you<br>&gt; &gt; have received this message in error, please immediately notify the [hidden<br>&gt; &gt; email] and delete it from your system as well as any copies. The content of<br>&gt; &gt; e-mails as well as traffic data may be monitored by NDS for employment and<br>&gt; &gt; security purposes.<br>&gt; &gt; To protect the environment please do not print this e-mail unless necessary.<br>&gt; &gt;<br>&gt; &gt; An NDS Group Limited company. www.nds.com<br>&gt; &gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; rules-users mailing list<br>&gt; &gt; [hidden email]<br>&gt; &gt; https://lists.jboss.org/mailman/listinfo/rules-users<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt; View message @<br>&gt; &gt; http://n3.nabble.com/Comparing-Date-with-OR-operator-tp347656p379447.html<br>&gt; &gt; To unsubscribe from Drools - Java Rules Engine, click here.<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt; Find your next place with Ninemsn&nbsp;property Looking for a place to rent,<br>&gt; &gt; share or buy?<br>&gt; &gt; ________________________________<br>&gt; &gt; View this message in context: RE: Comparing Date with || OR operator<br>&gt; &gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>&gt; &gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; rules-users mailing list<br>&gt; &gt; rules-users@lists.jboss.org<br>&gt; &gt; https://lists.jboss.org/mailman/listinfo/rules-users<br>&gt; &gt;<br>&gt; &gt;<br>&gt; <br>&gt; _______________________________________________<br>&gt; rules-users mailing list<br>&gt; rules-users@lists.jboss.org<br>&gt; https://lists.jboss.org/mailman/listinfo/rules-users<br>                                               <br><hr> Browse profiles for free! <a href="http://clk.atdmt.com/NMN/go/150855801/direct/01/">View photos of singles in your area.</a>                                               <br /><hr />Get straight to the Point <a href='http://clk.atdmt.com/NMN/go/157637060/direct/01/' target='_new'>Find a great deal on your next car.</a></body>
</html>