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

Rule compilation can fail when using an attribute/method of OOPath provided variable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 7.4.1.Final
    • Fix Version/s: None
    • Component/s: core engine
    • Labels:
      None
    • Sprint:
      2017 Week 45-46
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      Having a test like this:
      https://gist.github.com/mackaypeter/d8b576ce34d42794da559308b1854aff

      Produces the following error:

      Unable to Analyse Expression this.getName() == "joe":
      [Error: unable to resolve method using strict-mode: org.drools.compiler.oopath.MyTest$Parent.getName()]
      [Near : {... this.getName() == "joe" ....}]
                        ^
      [Line: 4, Column: 2] : [Rule name='R']
      

      It seems like it tries to look for the method definition in the Parent class instead of the Child class. The rule works correctly when there's a getName method defined in Parent. Meaning the rule compiles and fires correctly.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mfusco Mario Fusco
                Reporter:
                pmackay Peter Mackay
                Tester:
                Tibor Zimanyi
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: