[rules-users] Setting strictTyping/strongTyping modes
Mark Proctor
mproctor at codehaus.org
Wed Mar 21 16:04:20 EDT 2012
On 21/03/2012 18:45, barnesjd wrote:
> I'm trying to disable strictTyping for my MVEL rules, but I cannot figure out
> how. http://mvel.codehaus.org/MVEL+2.0+Typing The only example I've found
> shows the use of the class ParserContext. I'm using KnowledgeBuilder,
> KnowledgeBase, StatefulKnowledgeSession, etc. to run my rules. I don't see
> any methods where I can disable strictTyping or get the ParserContext, so
> I'm out of ideas.
>
> Can anyone point me in the right direction?
http://docs.jboss.org/drools/release/5.4.0.Beta2/knowledge-api-javadoc/org/drools/KnowledgeBaseConfiguration.html
And MVEL supports the following configurations:
* drools.dialect.mvel.strict = <true|false>
However we would recommend instead that you don't use that configuration
and instead use the @typesafe annotation on class declarations. So you
relax just specific classes, rather than relaxing everything.
http://docs.jboss.org/drools/release/5.4.0.Beta2/drools-expert-docs/html_single/index.html
5.7.2.1.2. @typesafe( <boolean> )
By default all type declarations are compiled with type safety enabled;
@typesafe( false ) provides a means to override this behaviour by
permitting a fall-back, to type unsafe evaluation where all constraints
are generated as MVEL constraints and executed dynamically. This can be
important when dealing with collections that do not have any generics or
mixed type collections.
>
> Thanks!
> Joe
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Setting-strictTyping-strongTyping-modes-tp3846477p3846477.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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120321/e999f3f9/attachment.html
More information about the rules-users
mailing list