Bug 851272

Summary: KnowledgeAgent: Doesn't remove insertLogical() Facts correctly with incremental build
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Mario Fusco <mfusco>
Component: BRE (Expert, Fusion)Assignee: Mario Fusco <mfusco>
Status: VERIFIED --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.1   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mario Fusco 2012-08-23 16:01:54 UTC
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

Comment 1 Radovan Synek 2012-09-20 09:03:13 UTC
Verified on 5.3.1.BRMS-ER1