[rules-users] How to set drools.dialect.mvel.strict = false?

Wolfgang Laun wolfgang.laun at gmail.com
Wed Jun 5 01:27:26 EDT 2013


The error message suggests that you have made a syntactic error in a
rule which is not the one you have posted, or you have modified the
rule too much to be of any help. Post again, taking great care not to
omit anything or to change the cause of the problem. Also, indicate
precisely the declaration of the function compareDatesWithTime().

-W


On 04/06/2013, jeetendray <jeetcyb at gmail.com> wrote:
> Hi,
>
> Snippet of my DRL .
>
> rule "Rev: Start Time < 2 Hours in Future"
> 	when
> 		$obj : eval(compareDatesWithTime(startDateTime, -2, 2, "<"))
> 	then
> 		$obj.addFailedRule("Rev: Start Time < 2 Hours in Future");
> end
>
> This fails during compilation and throws error:
>
> org.drools.rule.InvalidRulePackage: Unable to Analyse Expression
> (eval(compareDatesWithTime(startDateTime, -2, 2, "<"))  ):
> [Error: unable to resolve method using strict-mode: myObject.eval(boolean)]
> [Near : {... (eval(compareDatesWithTime(star ....}]
>              ^
> [Line: 6, Column: 2] : [Rule name='Proposal - Start time is after current +
> 2 hour']
>
>
> I am using Drools 5.5 and I found the cause that my code runs in strict
> mode.. so If I set strict mode to false then this would work. Now I am not
> sure how to make it to false.
>
> Here's the code I am using:
>
> PackageBuilderConfiguration packageBuilderConfiguration = new
> PackageBuilderConfiguration();
> PackageBuilder packageBuilder = new
> PackageBuilder(packageBuilderConfiguration);
> packageBuilder.addPackageFromDrl(drl.getCharacterStream());
>
> Can someone please suggest me how to do that??
>
> Thanks!!!
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/How-to-set-drools-dialect-mvel-strict-false-tp4024122.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list