Red Hat Bugzilla – Bug 973677
Declaration of sliding windows don't work.
Last modified: 2014-08-06 16:20:03 EDT
Description of problem:
When events are inserted into kiesession, declarated sliding window is used in rule or in query and rule is fired or query is called, then result doesn't contain required events limited by sliding window.
Version-Release number of selected component (if applicable):
Pull request #214 submited in Drools.
Steps to Reproduce:
1. Make a drl file with declaration of sliding (length or time) window, write rule or query, which use this window and returns number of inserted events limited by sliding window.
2. Write a test. Gradually insert events into kiesession one by one.
3. After each insertion, fire all rules or call query.
Results are all inserted events, even events above limit (defined by sliding window).
Results should be events, which are under limit (defined by sliding window). For example: last ten events or events in the last 100ms
Declarations of both types (time and length) of sliding windows don't work. When declaration of sliding window is not used only time sliding window works (bug #973661).
I merged the tests and checked that they are passing now. Very likely the problem was caused by the fact that the kieBase was running in cloud mode (even if properly configured in the provided test to run in stream mode). I also added a check to enforce that stream mode is used when necessary. This means that if you now try to run in cloud mode a kiebasae that actually requires the stream one (because it uses sliding windown or other fusion related features) it will throw a RuntimeException saying:
"The requested KieBase $kiebasename has been set to run in CLOUD mode but requires features only available in STREAM mode"
Verified on BRMS 6.0.0.ER5.