Bug 995140 - Sliding windows - Rule is being fired even when LHS is false
Summary: Sliding windows - Rule is being fired even when LHS is false
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.3.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: GA
: ---
Assignee: Mario Fusco
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 986451
TreeView+ depends on / blocked
 
Reported: 2013-08-08 16:00 UTC by Mario Fusco
Modified: 2024-01-01 01:36 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBRULES-3201 0 Major Open Sliding windows - Rule is being fired even when LHS is false 2014-05-02 09:32:08 UTC

Description Mario Fusco 2013-08-08 16:00:28 UTC
I have a rule that accumulate fact into sliding window. When the count get to a certain threshold the rule should be activated. After the window time is over, I expect that the rule will not fired anymore. The counter of the fact is report as 0, but still the rule is being executed.

drl :

package com.sample;
import com.sample.WindowLength.FactTest;

declare FactTest
@role( event )
end

rule "A500 : test"
when
// count devices per tag id
$counter : Number( intValue >= 2 ) from accumulate (
$d : FactTest() over window:time(1m), count($d))

then
System.out.println("A500: Rule is fired, count = " + $counter + " *********");
end

scenario:

ksession.insert(new FactTest());
ksession.fireAllRules();
ksession.insert(new FactTest());
ksession.fireAllRules();
ksession.insert(new FactTest());
ksession.fireAllRules();

SessionPseudoClock clock = ksession.getSessionClock();
clock.advanceTime(1, TimeUnit.MINUTES );

ksession.fireAllRules();

Result:
A500: Rule is fired, count = 2 *********
A500: Rule is fired, count = 3 *********
A500: Rule is fired, count = 0 *********

Comment 2 Tomas Schlosser 2013-09-11 12:31:33 UTC
Verified in 5.3.1.BRMS-P04


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