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

KnowledgeAgent: Doesn't remove insertLogical() Facts correctly with incremental build

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

    XMLWordPrintable

Details

    • Hide

      1. Create a Drools Project with the attached files.
      2. Update the file path from the sample.drl
      3. Build and run it
      4. Switch the two LHS statements of the rule "Hello World 2" in Sample.drl and wait for the KnowledgeAgent Update
      5. Repeat 4. if necessary

      Show
      1. Create a Drools Project with the attached files. 2. Update the file path from the sample.drl 3. Build and run it 4. Switch the two LHS statements of the rule "Hello World 2" in Sample.drl and wait for the KnowledgeAgent Update 5. Repeat 4. if necessary

    Description

      When the KnowledgeAgent is used with the property "newInstance = false" (incremental build), then facts inserted with insertLogical() don't always get removed correctly when there is a rule update. As i understand it, all facts which are inserted via insertLogical() should be retracted when the old rule is removed. With some rules of mine this is done correctly, but with other only a part is getting removed.

      I created a little test project based upon the drools example project where the problem always happens. After setting up the KnowledgeAgent, KnowledgeBase and StatefulKnowledgeSession, 3 facts are inserted into the session, which fires 9 consequences. Each consequence creates an object and inserts it via insertLogical. When i switch the two statements of the LHS from

      when
              Message(status == Message.HELLO)
              Message()
      

      TO:

      when
              Message()
              Message(status == Message.HELLO)
      

      When the rule is removed only 3 of the 9 objects get retracted.

      The code and a log for the eclipse audit view from this this case are attached

      Attachments

        1. Drools Project.zip
          13 kB
        2. test.log
          26 kB

        Activity

          People

            mfusco@redhat.com Mario Fusco
            rond_jira Torsten Schöne (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty