Bug 995140 - Sliding windows - Rule is being fired even when LHS is false
Sliding windows - Rule is being fired even when LHS is false
Status: VERIFIED
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion) (Show other bugs)
BRMS 5.3.1
Unspecified Unspecified
unspecified Severity unspecified
: GA
: ---
Assigned To: Mario Fusco
Tomas Schlosser
:
Depends On:
Blocks: 986451
  Show dependency treegraph
 
Reported: 2013-08-08 12:00 EDT by Mario Fusco
Modified: 2013-09-11 08:31 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBRULES-3201 Major Open Sliding windows - Rule is being fired even when LHS is false 2014-05-02 05:32:08 EDT

  None (edit)
Description Mario Fusco 2013-08-08 12:00:28 EDT
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 08:31:33 EDT
Verified in 5.3.1.BRMS-P04

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