<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">It shouldn't do, and could be a bug. Can you try 5.6.0.SNAPSOT and see if it is still a problem.<div><br></div><div>Mark<br><div><div>On 24 Jul 2013, at 18:22, Jeet Singh &lt;<a href="mailto:jeetcyb@gmail.com">jeetcyb@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>Alright, I kinda found out the cause of the exception I am getting, however I am still struggling the reason behind the exception.</div><div>&nbsp;</div><div>So DRL_1, this works perfectly fine.<br></div><div>
<font color="#9900ff" face="courier new,monospace">package drools;<br>import drools.ProposalLight;<br>import function drools.DateUtil.compareDatesWithTime;<br>rule "Date Rule"<br>when<br>&nbsp;&nbsp;&nbsp; $obj : ProposalLight(eval(compareDatesWithTime(endDateTime, -2, 6, \"&lt;\")))</font></div>
<div><font color="#9900ff" face="courier new,monospace">then<br>&nbsp;&nbsp;&nbsp; $obj.addFailedRule("Date Rule");<br>end;</font></div><div>&nbsp;</div><div>DRL_2, this doesn't work. and throws [Error: unable to resolve method using strict-mode: myObject.eval(boolean)]&nbsp; [Near : {... (eval(compareDatesWithTime(star ....}] ...</div>
<div>&nbsp;</div><div><div><font color="#9900ff" face="courier new,monospace">package drools;<br>import drools.ProposalLight;<br>import function drools.DateUtil.compareDatesWithTime;<br>rule "Date Rule"<br>when<br>&nbsp;&nbsp;&nbsp; $obj : ProposalLight(<strong><font color="#0000ff">(</font></strong>eval(compareDatesWithTime(endDateTime, -2, 6, \"&lt;\"))<strong><font color="#0000ff">)</font></strong>)</font></div>
<div><font color="#9900ff" face="courier new,monospace">then<br>&nbsp;&nbsp;&nbsp;&nbsp;$obj.addFailedRule("Date Rule");<br>end;</font></div></div><div>&nbsp;</div><div>Notice that extra paranthesis around eval(). This is where Drools 5.5 throws exception. Can someone please explain why this extra paranthesis throws exception and how can I make it work.</div>
<div>&nbsp;</div><div>Thanks,</div><div>Jeetendra.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 5, 2013 at 1:27 AM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The error message suggests that you have made a syntactic error in a<br>
rule which is not the one you have posted, or you have modified the<br>
rule too much to be of any help. Post again, taking great care not to<br>
omit anything or to change the cause of the problem. Also, indicate<br>
precisely the declaration of the function compareDatesWithTime().<br>
<span class="HOEnZb"><font color="#888888"><br>
-W<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On 04/06/2013, jeetendray &lt;<a href="mailto:jeetcyb@gmail.com">jeetcyb@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; Snippet of my DRL .<br>
&gt;<br>
&gt; rule "Rev: Start Time &lt; 2 Hours in Future"<br>
&gt; &nbsp; &nbsp; &nbsp; when<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $obj : eval(compareDatesWithTime(startDateTime, -2, 2, "&lt;"))<br>
&gt; &nbsp; &nbsp; &nbsp; then<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $obj.addFailedRule("Rev: Start Time &lt; 2 Hours in Future");<br>
&gt; end<br>
&gt;<br>
&gt; This fails during compilation and throws error:<br>
&gt;<br>
&gt; org.drools.rule.InvalidRulePackage: Unable to Analyse Expression<br>
&gt; (eval(compareDatesWithTime(startDateTime, -2, 2, "&lt;")) &nbsp;):<br>
&gt; [Error: unable to resolve method using strict-mode: myObject.eval(boolean)]<br>
&gt; [Near : {... (eval(compareDatesWithTime(star ....}]<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^<br>
&gt; [Line: 6, Column: 2] : [Rule name='Proposal - Start time is after current +<br>
&gt; 2 hour']<br>
&gt;<br>
&gt;<br>
&gt; I am using Drools 5.5 and I found the cause that my code runs in strict<br>
&gt; mode.. so If I set strict mode to false then this would work. Now I am not<br>
&gt; sure how to make it to false.<br>
&gt;<br>
&gt; Here's the code I am using:<br>
&gt;<br>
&gt; PackageBuilderConfiguration packageBuilderConfiguration = new<br>
&gt; PackageBuilderConfiguration();<br>
&gt; PackageBuilder packageBuilder = new<br>
&gt; PackageBuilder(packageBuilderConfiguration);<br>
&gt; packageBuilder.addPackageFromDrl(drl.getCharacterStream());<br>
&gt;<br>
&gt; Can someone please suggest me how to do that??<br>
&gt;<br>
&gt; Thanks!!!<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; View this message in context:<br>
&gt; <a href="http://drools.46999.n3.nabble.com/How-to-set-drools-dialect-mvel-strict-false-tp4024122.html" target="_blank">http://drools.46999.n3.nabble.com/How-to-set-drools-dialect-mvel-strict-false-tp4024122.html</a><br>

&gt; Sent from the Drools: User forum mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br></div>
_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users</blockquote></div><br></div></body></html>