Bug 852054 - Collection is not updated in working memory
Summary: Collection is not updated in working memory
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.3.0.GA
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Edson Tirelli
QA Contact: Iva Zakova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-27 13:04 UTC by Iva Zakova
Modified: 2013-03-01 05:01 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-29 16:53:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Iva Zakova 2012-08-27 13:04:35 UTC
Description of problem:
When changing elements of collection which is in working memory and calling the update (in program), rules are not evaluated again.

Version-Release number of selected component (if applicable):
BRMS 5.3.0

How reproducible:
Pull-request incoming

Steps to Reproduce:
1. Insert collection in working memory with a couple of elements.
2. Add / remove / change its element in program.
3. Call the update in program.
4. Verify re-evaluating the rules.
  
Actual results:
Rules are not re-evaluated again.

Expected results:
Rules to be re-evaluated again.

Additional info:

Comment 1 Iva Zakova 2012-08-28 06:03:59 UTC
Pul requested https://github.com/droolsjbpm/drools/pull/140 submitted

Comment 2 Edson Tirelli 2012-08-29 16:40:41 UTC
The test case has a mistake. After updating the collection, the application has to fire rules again, otherwise the actions on the rule will not be executed:

ksession.update(handle, collection);
ksession.fireAllRules();

Also, please note that since the collection is updated, and based on the way the rule is written, it will fire again for all elements in the collection. So the end result is the rule will fire 9 times, not 5:

assertEquals(9, results.size());

The engine is working as expected. This is not a bug.


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