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

Reset FactHandleId on KieSession.dispose

    XMLWordPrintable

Details

    • Task
    • Status: Verified (View Workflow)
    • Major
    • Resolution: Done
    • 7.11.1.GA
    • 7.12.0.GA
    • BRE

    Description

      While upgrading from RHDM 7.8 to 7.10 (Drools 7.39.x to 7.48.x) we noticed a change to the FactHandleId values when disposing a KieSession instance and creating a new one.

      For audit purposes during our test runs, we configure a RuleRuntimeEventListener to capture the facts details:

      ksession.addEventListener(new DefaultRuleRuntimeEventListener() {
         public void objectInserted(ObjectInsertedEvent event) {
            InternalFactHandle ifh = (InternalFactHandle) event.getFactHandle();
            System.out.println("Object inserted. ID=" + ifh.getId());
         }
      });
      

      In 7.39.x release, if we dispose kiesession, factHandler reset:

      Object inserted. ID=1
      Hello World
      Object inserted. ID=2
      New kie-session generated
      Object inserted. ID=1
      Hello World
      Object inserted. ID=2
      

      But with 7.48.x release, it keep increasing:

      Object inserted. ID=1
      Hello World
      Object inserted. ID=2
      New New kie-session generated
      Object inserted. ID=3
      Hello World
      Object inserted. ID=4
      

      Is there a way to reconfigure the fact ids to reset to 1 for each new ksession?

      Attachments

        Activity

          People

            lmolteni@redhat.com Luca Molteni
            rhn-support-mputz Martin Weiler
            Paolo Bizzarri Paolo Bizzarri
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: