[jboss-jira] [JBoss JIRA] (DROOLS-244) Sliding windows working incorrectly when timestamp attribute is defined
Vytautas Gimbutas (JIRA)
jira-events at lists.jboss.org
Sat Sep 7 19:09:03 EDT 2013
[ https://issues.jboss.org/browse/DROOLS-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802584#comment-12802584 ]
Vytautas Gimbutas commented on DROOLS-244:
------------------------------------------
If i move windows to accumulates directly I still experience the same issue. I hope that commit fixes for both window definition types.
rule file to reproduce issue with windows inside accumulates:
package rules;
import java.math.BigDecimal;
import test.Transaction;
import test.TransactionCreatedEvent;
import test.TransactionCompletedEvent;
import org.drools.runtime.rule.RuleContext;
declare TransactionCreatedEvent
@role( event )
@expires( 183d )
@timestamp(created)
end
declare TransactionCompletedEvent
@role( event )
@expires( 183d )
@timestamp(created)
end
rule transaction_count_over_last_day
when
$transaction : Transaction()
$transactionCreatedEventCount : Number() from accumulate($tce : TransactionCreatedEvent() over window:time(1s) from entry-point "TransactionCreatedEventStream" , count($tce))
$transactionCompletedEventCount : Number() from accumulate($tce2 : TransactionCompletedEvent() over window:time(1s) from entry-point "TransactionCompletedEventStream" , count($tce2))
then
System.out.println($transactionCreatedEventCount);
System.out.println($transactionCompletedEventCount);
end
> 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