Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1068

Invalid result with collect, mvel and ForceEagerActivationOption.YES

    Details

    • Type: Bug
    • Status: Verified (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 7.4.1.GA
    • Fix Version/s: 7.5.0.GA
    • Component/s: BRE
    • Labels:
      None
    • Target Release:
    • Fix Build:
      CR1
    • Steps to Reproduce:
      Hide

      See test case in the linked PR as well as the attached reproducer (same rules, just added to run it easily against different versions).

      Show
      See test case in the linked PR as well as the attached reproducer (same rules, just added to run it easily against different versions).
    • Sprint:
      2019 Week 35-37
    • QE Test Coverage:
      +

      Description

      A rule updates a list in a fact:

      rule "Init"
          dialect "mvel"
          when
              $fl: FactWithList(items.size()==0)
          then
              $fl.getItems().add("A");
              $fl.getItems().add("B");
              update($fl);
      end
      

      A second rule verifies if other facts exist, matching the items in the updated list:

      rule "Expected Outcome"
          dialect "mvel"
          when
              $fl: FactWithList($itemList : items != null)
              $l: java.util.ArrayList(size > 0) from collect(FactWithString($itemList contains stringValue));
          then
              System.out.println("--> Rule: " + kcontext.getRule().getName() + " fired, " + $fl + ", collect list: " + $l.size());
      end
      

      This rule is not fired if

      • mvel dialect is used and
      • Drools is executed with ForceEagerActivationOption.YES (jBPM use case)

      Note: This worked in 7.17 and earlier!

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mfusco Mario Fusco
                  Reporter:
                  mputz Martin Weiler
                  Tester:
                  Daniel Rosa
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: