Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-325

Conditional named consequences don't allow references to public fields

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 6.0.0.CR5
    • None

    Description

      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.

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            rhn-gps-ddoyle Duncan Doyle (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: