[jboss-jira] [JBoss JIRA] (JBRULES-3201) Sliding windows - Rule is being fired even when LHS is false
RH Bugzilla Integration (JIRA)
jira-events at lists.jboss.org
Thu Aug 8 12:09:27 EDT 2013
[ https://issues.jboss.org/browse/JBRULES-3201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795869#comment-12795869 ]
RH Bugzilla Integration commented on JBRULES-3201:
--------------------------------------------------
Mario Fusco <mfusco at redhat.com> changed the Status of [bug 995140|https://bugzilla.redhat.com/show_bug.cgi?id=995140] from NEW to MODIFIED
> Sliding windows - Rule is being fired even when LHS is false
> ------------------------------------------------------------
>
> Key: JBRULES-3201
> URL: https://issues.jboss.org/browse/JBRULES-3201
> Project: JBRULES
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-core (fusion)
> Affects Versions: 5.3.0.Beta1
> Environment: Linux
> Reporter: eyal rahamim
> Assignee: Mark Proctor
> Labels: `
> Attachments: windowLength.drl, WindowLength.java
>
>
> 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 *********
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list