[jboss-jira] [JBoss JIRA] (DROOLS-244) Sliding windows working incorrectly when timestamp attribute is defined

Davide Sottara (JIRA) jira-events at lists.jboss.org
Sun Sep 8 03:13:03 EDT 2013


    [ https://issues.jboss.org/browse/DROOLS-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802592#comment-12802592 ] 

Davide Sottara commented on DROOLS-244:
---------------------------------------

Sliding windows do not "expire" facts based on their timestamps, but on the number of events of the same type. 
However, global expiration (@expires) policies may cause events to be retracted from the WM (and thus from the windows too) before the rules fire.

I see your expectation, however the @expire time is calculated as

MAX( @timestamp + @duration, NOW** ) + @expire

Now, That "MAX" makes me wonder a little bit... I will have to ask Edson

** I assume you are working in STREAM mode and using the REALTIME clock, otherwise automatic expiration will be disabled
                
> Sliding windows working incorrectly when timestamp attribute is defined
> -----------------------------------------------------------------------
>
>                 Key: DROOLS-244
>                 URL: https://issues.jboss.org/browse/DROOLS-244
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>            Reporter: Vytautas Gimbutas
>            Assignee: Mark Proctor
>         Attachments: app-ss-test-case.zip, Event.java, file.drl, Transaction.java, TransactionCompletedEvent.java, TransactionCreatedEvent.java, TransactionEvent.java
>
>
> Download app-ss-test-case.zip and run TimestampAttributeTest.
> When timestamp attribute is set in the past (lets say with timestamp of 30 days ago) it falls in every sliding window over time (e.g. 1s).
> Expected output:
> 1
> 0
> Actual output:
> 1
> 1

--
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