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

Conditional named consequences don't allow MVEL expressions in the condition of an if statement

    XMLWordPrintable

Details

    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, uses an MVEL expression in the conditional 'if' statement, i.e. "if (m.status == Message.HELLO) break [sayHello]". The compiler throws this error:

      Rule Compilation error The field DroolsTest.Message.status is not visible.

      When I use a Java dialect and define the conditional if as " if (m.getStatus() == 0) break [sayHello]", as shown in the second rule everything works fine.

      Note that there is also an issue with using public constants in the condition, but I'll open another JIRA for that issue.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: