[jboss-jira] [JBoss JIRA] (DROOLS-325) Conditional named consequences don't allow references to public fields
Mario Fusco (JIRA)
jira-events at lists.jboss.org
Thu Nov 7 06:01:04 EST 2013
[ https://issues.jboss.org/browse/DROOLS-325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921204#comment-12921204 ]
Mario Fusco commented on DROOLS-325:
------------------------------------
I found where the problem is with the Message class: it has a field named message so it adds it to the set of the used declarations for the condition to be evaluated generating the method that clearly cannot compile.
{code}
public static boolean eval0( java.lang.String Message , int status ) throws java.lang.Exception {
return ( status == Message.HELLO );
}
{code}
> Conditional named consequences don't allow references to public fields
> ----------------------------------------------------------------------
>
> Key: DROOLS-325
> URL: https://issues.jboss.org/browse/DROOLS-325
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 6.0.0.CR5
> Environment: Mac OS-X 10.9, JBoss Developer Studio, Oracle Hotspot 1.7.0_45
> Reporter: Duncan Doyle
> Assignee: Mario Fusco
> Labels: conditional, consequences, named
>
> See this project, which is based on the standard Sample.drl of the Drools Eclipse plugin:
> https://github.com/DuncanDoyle/DroolsConditionalNamedConsequenceIssue
> As you can see in the 'src/main/resources/rules/Sample.drl', the first rule, which is commented out, references the public fields Message.HELLO and Message.GOODBYE in the conditional 'if' statement, i.e. "if (m.status == Message.HELLO) break [sayHello]". The compiler throws this error:
> Rule Compilation error HELLO cannot be resolved or is not a field.
> When I use the actual value of Message.HELLO and Message.GOODBYE, as shown in the second rule 'if (m.getStatus() == 0) break [sayHello]', everything works fine.
> Please note that there is also an issue with using MVEL expressions in Conditional named consequences (as you can see in my example rules). That issue is tracked in JIRA DROOLS-324.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list