Bug 973661

Summary: Sliding length window doesn't work
Product: [Retired] JBoss BRMS Platform 6 Reporter: Tomas David <tdavid>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED CURRENTRELEASE QA Contact: Tomas David <tdavid>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: rrajasek
Target Milestone: ER5   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:15:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomas David 2013-06-12 13:01:04 UTC
Description of problem:
When length sliding windows is defined in query with specific value X in drl file, events are gradually inserted into kiesession and query is called, result always contains all inserted events, but it should contains only X last values.

Version-Release number of selected component (if applicable):
Drools 6.0.0.Beta3

How reproducible:
Pull request #214 submited in Drools.

Steps to Reproduce:
1. Make a drl file with one query (using length sliding window), which accumulates last ten events and returns number of accumulated events.
2. Write a test, gradually insert into kiesession events one by one.
3. After each insertion, run query.

Actual results:
Returns all inserted events (1, 2, 3, ..., 10, 11, 12, 13, 14, ...)-

Expected results:
It should returns last ten events (1, 2, 3, ..., 10, 10, 10, 10, ...).

Additional info:

Comment 4 Mario Fusco 2013-10-10 08:18:51 UTC
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"

Comment 5 Tomas David 2013-11-25 11:31:47 UTC
Verified on BRMS 6.0.0.ER5.