[jboss-jira] [JBoss JIRA] (DROOLS-2135) Rule compilation can fail when using an attribute/method of OOPath provided variable

Peter Mačkay (JIRA) issues at jboss.org
Wed Nov 15 10:30:00 EST 2017


Peter Mačkay created DROOLS-2135:
------------------------------------

             Summary: Rule compilation can fail when using an attribute/method of OOPath provided variable
                 Key: DROOLS-2135
                 URL: https://issues.jboss.org/browse/DROOLS-2135
             Project: Drools
          Issue Type: Bug
          Components: core engine
    Affects Versions: 7.4.1.Final
            Reporter: Peter Mačkay
            Assignee: Mario Fusco
            Priority: Minor


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

Produces the following error:
{code}
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']
{code}

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.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)



More information about the jboss-jira mailing list