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

Drools unable to compile rules when using a declared enum in the DRL file

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Sprint:
      2019 Week 29-31, 2019 Week 32-34, 2019 Week 35-37
    • Story Points:
      7
    • Steps to Reproduce:
      Hide

      I have attached a zip of a very simple project with included test cases.

      This can be compiled using maven, but when executing the rules through the included test case, it fails - giving "Error: unqualified type".

      There is another test that reads the very same drl file through an alternate method, and the test passes.

      Show
      I have attached a zip of a very simple project with included test cases. This can be compiled using maven, but when executing the rules through the included test case, it fails - giving "Error: unqualified type". There is another test that reads the very same drl file through an alternate method, and the test passes.
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      I am finding inconsistent behaviour between drools reading rules from a local file (as a fileSystemResource) as opposed to pre compiling the rules into a kjar.

      This happens if I use an enum declared within the drl file in the "when" or "then" section of a rule within the same drl file.

      The rule runs perfectly as expected if I load the rule from the filesystem, but fails to run if I have pre-compiled the rule. For this reason I think this is a bug as I would expect the same behaviour for both ways of running rules.

      I outlined the problem in more detail stackoverflow:

      https://stackoverflow.com/questions/56989080/drools-maven-plugin-not-understanding-locally-declared-enums-when-compiling-drl

      This is running JAVA8 and drools 7.23.0.Final

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                volothamp Luca Molteni
                Reporter:
                rawbb Robert Buchmann
                Tester:
                Tibor Zimanyi
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: