Bug 724234 (BRMS-178) - update(fact) doesn't work in ruleflow
Summary: update(fact) doesn't work in ruleflow
Keywords:
Status: CLOSED NEXTRELEASE
Alias: BRMS-178
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: unspecified
Version: unspecified
Hardware: Unspecified
OS: Unspecified
urgent
unspecified
Target Milestone: ---
: 5.0.1
Assignee: Kris Verlaenen
QA Contact:
URL: http://jira.jboss.org/jira/browse/BRM...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-07 15:17 UTC by nwallace
Modified: 2009-09-28 06:12 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-01 12:27:45 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker BRMS-178 0 Critical Closed update(fact) doesn't work in ruleflow 2018-04-27 08:52:15 UTC

Description nwallace 2009-07-07 15:17:14 UTC
Date of First Response: 2009-09-10 01:29:29
Workaround: Workaround Exists
Workaround Description: As a workaround one can do (in a on-exit action):
drools.getIdentityMap().put(someFact, drools.getWorkingMemory().getFactHandle(someFact));
and then it is safe to call
update(someFact);
securitylevel_name: Public

Hi,
org.drools.base.DefaultKnowledgeHelper uses newly added identityMap to keep track of fact handles. It looks like this identityMap is updated before a rule's consequence is called. However it is not updated before a Drools Flow on-exit action. This means that calling update(someFact) in a on-exit ruleflow action causes exception ("org.drools.FactException: Update error: handle not found for object: XXXXX. Is it in the working memory?"). 

this was tested on drools-core-5.0.0.20090417.044049-485.jar

Thanking you in advance.
Best Regards,
Michal

Comment 1 nwallace 2009-07-07 15:18:32 UTC
Link: Added: This issue is related to JBRULES-2077


Comment 2 nwallace 2009-09-01 12:27:45 UTC
Fix in place.

Comment 3 David Le Sage 2009-09-10 05:29:29 UTC
For documenting this in the Release Notes, can you please confirm the following and fill in the missing information. Dot point explanations are fine:

The CAUSE (what was actually broken)
 * the org.drools.base.DefaultKnowledgeHelper's identityMap was not updating before a Drools Flow "on-exit action" occurred.

CONSEQUENCES of the bug (how it impacts users.)
 * This meant that calling update(someFact) in an on-exit ruleflow action caused an exception error.

The FIX (what was changed to eliminate this bug) and 
 *

RESULTS of the fix (what now happens for users.)
 * 

Comment 4 David Le Sage 2009-09-23 05:40:16 UTC
We are still awaiting the outstanding information for the Release Notes on this one.  Please provide it as soon as possible. Thanks.

Comment 5 Kris Verlaenen 2009-09-23 13:06:13 UTC
The CAUSE (what was actually broken)
 * the org.drools.base.DefaultKnowledgeHelper's identityMap was not updating before a Drools Flow "on-exit action" occurred.

CONSEQUENCES of the bug (how it impacts users.)
 * This meant that calling update(someFact) in an on-exit ruleflow action caused an exception error.

The FIX (what was changed to eliminate this bug) and
 * making sure the identityMap is updated before on-exit actions are called

RESULTS of the fix (what now happens for users.)
 * update(fact) can now also be used in on-exit actions


Note You need to log in before you can comment on or make changes to this bug.