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

Map-accessing constraints stop matching after they are jit-optimized

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 6.0.0.Alpha1
    • 5.5.0.Final
    • drools-core
    • Workaround Exists
    • Hide

      The workaround I've found is to cast the result of Map.get() to Double:

      rule "Rule 2"
      when
      TestObject(((Double)data[Parameter.PARAM_A]) > 3)
      then
      System.out.println("Rule 2 fired!");
      end

      Show
      The workaround I've found is to cast the result of Map.get() to Double: rule "Rule 2" when TestObject(((Double)data [Parameter.PARAM_A] ) > 3) then System.out.println("Rule 2 fired!"); end

    Description

      Having the following rules:

      declare TestObject
      data : java.util.Map //This is a Map<Parameter, Double>
      end

      rule "Rule 2"
      when
      TestObject(data[Parameter.PARAM_A] > 3)
      then
      System.out.println("Rule 2 fired!");
      end

      And repeatedly inserting a TestObject with data[PARAM_A] = 4 into a session makes the rule to stop matching.
      Maybe the title of the issue is wrong and JIT has nothing to do, but that is the only explanation I've found.

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            esteban.aliverti@gmail.com Esteban Aliverti (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty