Bug 995140

Summary: Sliding windows - Rule is being fired even when LHS is false
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Mario Fusco <mfusco>
Component: BRE (Expert, Fusion)Assignee: Mario Fusco <mfusco>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.1CC: nwallace
Target Milestone: GA   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:28:18 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:
Bug Depends On:    
Bug Blocks: 986451    

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

Comment 6 Red Hat Bugzilla 2025-02-10 03:28:18 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.