Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3392

strict mode evaluation taking interface instead of class

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    Description

      I am getting a compilation error with my drl, that worked in 5.0.1:

      Unable to Analyse Expression las.id == $las.id:
      [Error: unable to resolve method using strict-mode: piag.entityinterface.ILink.id()]
      [Near :

      {... las.id == $las.id ....}

      ]
      ^
      [Line: 42, Column: 30] : [Rule name='rule1']

      here's the rule:
      rule "rule1"
      when
      $las : Link(name == "GA1")
      $pi : PayItem(las.id == $las.id, amount > 0, comparisonType == "ECHT")
      then ...

      interface ILink is empty:
      public interface ILink { }

      class Link extends ILink adds a few attributes including id, name, amount, comparisonType...

      interface IPayItem has this getter:
      public ILink getLas();

      class PayItem overrides this getter:
      @Override
      public Link getLas() {
      return this.las;
      }

      It seems like drools is incorrectly treating $pi as IPayItem. IPayItem.getLas() returns ILink which does not have method id(), as the message says. But PayItem.getLas() returns Link which does have attribute id.
      I didn't specify anywhere that $pi is IPayItem so why does it do this?

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            lubosh_jira Lubos Pechac (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty