[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1644) Make drools imply null checks before trying to read a value
Tim Nee (JIRA)
jira-events at lists.jboss.org
Mon Mar 7 15:33:45 EST 2011
[ https://issues.jboss.org/browse/JBRULES-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586423#comment-12586423 ]
Tim Nee commented on JBRULES-1644:
----------------------------------
According to MVEL [doc|http://mvel.codehaus.org/MVEL+2.0+Property+Navigation]
MVEL supports Null-Safe Bean Navigation
{code}user.?manager.name{code}
However I get following error if I try to use above syntax
{code}mismatched input '?' expecting 'identifier' in rule "MVEL Null Safe Rule" in pattern Context{code}
> Make drools imply null checks before trying to read a value
> -----------------------------------------------------------
>
> Key: JBRULES-1644
> URL: https://issues.jboss.org/browse/JBRULES-1644
> Project: Drools
> Issue Type: Feature Request
> Components: drools-compiler
> Affects Versions: 4.0.6
> Environment: all
> Reporter: Alex McCarrier
> Assignee: Mark Proctor
> Priority: Minor
> Fix For: FUTURE
>
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
>
> Not sure if this is MVEL or drools itself, but it would be nice if it would do null checks on fields for you rather than having the rule author do it. Example, when doing something like:
> when
> Object(value1.value2 == something)
>
>
> before attempting to read value2 it makes sure value1 is not null, and if value1 is null than rather than throwing an error like it does currently, just consider the rule as not matching.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list