Red Hat Bugzilla – Bug 852054
Collection is not updated in working memory
Last modified: 2013-03-01 00:01:47 EST
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):
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.
Rules are not re-evaluated again.
Rules to be re-evaluated again.
Pul requested https://github.com/droolsjbpm/drools/pull/140 submitted
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:
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:
The engine is working as expected. This is not a bug.