[
https://issues.jboss.org/browse/JBRULES-3373?page=com.atlassian.jira.plug...
]
Juanker Atina updated JBRULES-3373:
-----------------------------------
Steps to Reproduce:
1. I'm setting the stream mode to work with events (kbaseConfig.setOption(
EventProcessingOption.STREAM );)
2. I have a simple DRL file
declare StateEvent
@role( event )
end
rule "Test"
when
Number($total : doubleValue) from accumulate(
StateEvent(itemName=="Temperatura", $val : newState) over
window:length( 5 ) from entry-point "EventStream",
average ( ((DecimalType)$val).toBigDecimal().doubleValue() ) )
then
System.out.println("" + $total);
end
3. I insert a fact into working memory (entry point "EventStream")
WorkingMemoryEntryPoint entry =
ksession.getWorkingMemoryEntryPoint("EventStream");
entry.insert((RuleEvent) new StateEvent(item, state));
4. Fire rules
5. Repeat steps 3 and 4 to put accumulate and average functions to work
RESULTS WITH 5.2.0 Final
Works nicely, i can see the average updated with every fact inserted.
RESULTS WITH 5.3.0 Final
It returns the same result and average (neither sum or the simplest case count(1))
doesn't work.
was:
1. I'm setting the stream mode to work with events (kbaseConfig.setOption(
EventProcessingOption.STREAM );)
2. I have a simple DRL file
declare StateEvent
@role( event )
end
rule "Test"
when
Number($total : doubleValue) from accumulate(
StateEvent(itemName=="Temperatura", $val : newState) over
window:length( 5 ) from entry-point "EventStream",
average ( ((DecimalType)$val).toBigDecimal().doubleValue() ) )
then
System.out.println("" + $total);
end
3. I insert several facts into working memory (entry point "EventStream")
WorkingMemoryEntryPoint entry =
ksession.getWorkingMemoryEntryPoint("EventStream");
entry.insert((RuleEvent) new StateEvent(item, state));
4. Fire rules
RESULTS WITH 5.2.0 Final
Works nicely, i can see the average updated with every fact inserted.
RESULTS WITH 5.3.0 Final
It returns the same result and average (neither sum or the simplest case count(1))
doesn't work.
Accumulate function doesn't work at all in 5.3.0 Final
------------------------------------------------------
Key: JBRULES-3373
URL:
https://issues.jboss.org/browse/JBRULES-3373
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core
Affects Versions: 5.3.0.Final
Environment: Windows XP, JRE 6
Reporter: Juanker Atina
Assignee: Mark Proctor
Labels: accumulate, count, stream, sum
Attachments: OtraPrueba.java
Accumulate doesn't work in 5.3.0 Final, even the most basic cases. The same rules and
code work nicely with 5.2.0 Final.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira