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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • None
    • 7.4.1.Final
    • core engine
    • None
    • 2017 Week 45-46
    • NEW
    • 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.

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            pmackay@redhat.com Peter Mackay
            Tibor Zimányi Tibor Zimányi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: