<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>I'm new to drools, so hopefully I can post enough information to get some help. &nbsp;We are running Drools 5.3.3.Final (though we've seen the same issue with 5.4.0.Final and 5.3.0.Final)</div><div><br></div><div>I'm trying to test some rules created in drl format. &nbsp;Here's an example of a drl that executes fine – it checks a birthday field against a date literal:</div><div><br></div><div>------------------------------------------</div><div><br></div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">package drools.rules.funnelid.two</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">import com.infusionsoft.bpm.services.TestRuleFact;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">rule &quot;Test Rule&quot;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><span class="Apple-tab-span" style="white-space:pre">        </span>dialect &quot;java&quot;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><span class="Apple-tab-span" style="white-space:pre">        </span>when</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><span class="Apple-tab-span" style="white-space:pre">                </span>$testRuleFact : TestRuleFact( ( contactable.contact.birthday &lt; &quot;29-Dec-1977&quot; ) )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><span class="Apple-tab-span" style="white-space:pre">        </span>then</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><span class="Apple-tab-span" style="white-space:pre">                </span>$testRuleFact.setTrue( );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">end</p></p></div><div><br></div><div>-------------------------------------------</div><div><br></div><div>However, this drl fails compilation with the following error:</div><div><br></div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">package drools.rules.funnelid.two</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">import com.infusionsoft.bpm.services.TestRuleFact;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">rule &quot;Test Rule&quot;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><span class="Apple-tab-span" style="white-space:pre">        </span>dialect &quot;java&quot;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><span class="Apple-tab-span" style="white-space:pre">        </span>when</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><span class="Apple-tab-span" style="white-space:pre">                </span>$testRuleFact : TestRuleFact( ( contactable.contact.title str[equals] &quot;Owner&quot; &amp;&amp; contactable.contact.birthday &lt; &quot;01-Jan-1980&quot; ) || ( contactable.contact.country str[equals] &quot;USA&quot; &amp;&amp; contactable.contact.leadSourceIdOverride == &quot;12&quot; ) )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><span class="Apple-tab-span" style="white-space:pre">        </span>then</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><span class="Apple-tab-span" style="white-space:pre">                </span>$testRuleFact.setTrue( );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">End</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">------------------------------------------</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">Here's the error I get:</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">DRL contains errors, no actions will be processed: Unable to Analyse Expression str0.evaluate( contactable.contact.title, &quot;Owner&quot; ) &amp;&amp; contactable.contact.birthday &lt; &quot;01-Jan-1980&quot; || str1.evaluate( contactable.contact.country, &quot;USA&quot; ) &amp;&amp; contactable.contact.leadSourceIdOverride == &quot;12&quot;:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">[Error: Comparison operation requires compatible types. Found class java.util.Date and class java.lang.String]</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">[Near : {... ) &amp;&amp; contactable.contact.leadSourceIdOverride == &quot;12&quot; ....}]</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">[Line: 8, Column: 32] : [Rule name='Test Rule']</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"><br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica">Some things that cause the error to go away:</p><ul><li><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; text-decoration: none; ">Removing the offending clause:&nbsp;&nbsp;contactable.contact.birthday &lt; &quot;01-Jan-1980&quot;</span></li><li>Changing the || to an &amp;&amp;&nbsp;</li></ul><div>I'm at a loss and would love some help. &nbsp;Even if I knew which class was raising the exception would help, but I can't seem to find it anywhere.</div><div><br></div><div>Thanks,</div><div>Eric</div></p></div></body></html>