Bug 973661 - Sliding length window doesn't work
Summary: Sliding length window doesn't work
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE (Show other bugs)
(Show other bugs)
Version: 6.0.0
Hardware: Unspecified Unspecified
Target Milestone: ER5
: 6.0.0
Assignee: Mario Fusco
QA Contact: Tomas David
Depends On:
TreeView+ depends on / blocked
Reported: 2013-06-12 13:01 UTC by Tomas David
Modified: 2014-08-06 20:15 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-08-06 20:15:44 UTC
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

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.

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