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

Rule compilation error when binding fields indexed with square brackets from different Fact types

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 7.37.0.Final
    • Fix Version/s: None
    • Component/s: core engine
    • Labels:
      None
    • Sprint:
      2020 Week 19-21 (from May 4)
    • Steps to Reproduce:
      Hide

      run:

      mvn clean test
      

      on attached reproducer.

      Show
      run: mvn clean test on attached reproducer.
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      Similar to DROOLS-5216, but occurs when binding the field from a different Fact type.

      Example:

          rule "binding field indexed with square brackets from different fact type"
          when Pojo2($firstItem : simpleInt)
          Pojo($firstItem == integerList[this.integerList.size()-1])
          then
          end
      

      Error:

          Message [id=1, kieBase=binding-field-indexed-with-square-brackets, level=ERROR, path=org/drools/reproducer/rules.drl, line=-1, column=0
             text=Comparison operation requires compatible types. Found int and class java.lang.Object]
      

      The example works fine when compiling without executable model.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mfusco Mario Fusco
                Reporter:
                mcasalino Matteo Casalino
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: