Bug 852054 - Collection is not updated in working memory
Collection is not updated in working memory
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion) (Show other bugs)
BRMS 5.3.0.GA
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Edson Tirelli
Iva Zakova
Depends On:
  Show dependency treegraph
Reported: 2012-08-27 09:04 EDT by Iva Zakova
Modified: 2013-03-01 00:01 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-08-29 12:53:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Iva Zakova 2012-08-27 09:04:35 EDT
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 02:03:59 EDT
Pul requested https://github.com/droolsjbpm/drools/pull/140 submitted
Comment 2 Edson Tirelli 2012-08-29 12:40:41 EDT
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);

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.