[jboss-jira] [JBoss JIRA] (JBRULES-3521) accumulation function ignores conditions in 5.4.0.Final
Chris Austin (JIRA)
jira-events at lists.jboss.org
Wed May 30 15:39:19 EDT 2012
[ https://issues.jboss.org/browse/JBRULES-3521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697265#comment-12697265 ]
Chris Austin edited comment on JBRULES-3521 at 5/30/12 3:39 PM:
----------------------------------------------------------------
Found a few more details:
* alpha constraints are not checked
* beta constraints are checked
* only occurs under WindowNode
Two workarounds (for my case):
* switch from "over window:time(5d)" to "this before[5d] $latestEvent"
* switch to beta constraints by comparing to the $latestEvent fields (hackish and inefficient)
was (Author: chrisxaustin):
Tested locally, and found that alpha constraints are ignored, though beta constraints work as expected.
> accumulation function ignores conditions in 5.4.0.Final
> -------------------------------------------------------
>
> Key: JBRULES-3521
> URL: https://issues.jboss.org/browse/JBRULES-3521
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-compiler (fusion)
> Affects Versions: 5.4.0.Final
> Environment: windows 7 x64, tested with jdk 6 and 7
> Reporter: Radai Rosenblatt
> Assignee: Mark Proctor
> Attachments: accumulationBug.zip
>
>
> given this drl:
> {code:title=average.drl|borderStyle=solid}
> package playground
> import playground.datamodel.EventObject
> declare EventObject
> @role( event )
> end
> rule "new event under average"
> when
> $latestEvent : EventObject(level == "Full", status == "success", $size : size ) from entry-point "Event Stream"
> Number($averageSize : doubleValue, doubleValue > ($size)) from accumulate( EventObject(level=="Full", this before $latestEvent, status == "success", $bSize : size ) over window:time( 5d ) from entry-point "Event Stream" , average($bSize))
> then
> System.err.println("new event under 5d average");
> end
> {code}
> and the following sequence of 3 events:
> {Full,success,100},{Whatever,fail,0},{Full,success,99}
> the 3rd event should trigger a firing. the complete breakdown of events should be as follows:
> 1. 1st event is inserted, average is 0 because there are no previous events - no firing.
> 2. 2nd event is inserted - does not match the conditions and therefore should not be accumulated.
> 3. 3rd event is inserted - accumulation should only consider the 1st event, hence the avg. is 100. the event value is 99, which is below the avg - rule should fire.
> this works with drools 5.1.1 but fails in 5.4.0.Final - in 5.4 the 2nd event is acounted by the average function and so the rule does not fire.
> attached is a complete maven project to recreate this bug - simply unzip and run "mvn clean install" to recreate.
> also in the mvn project attached, simply change the drools.version property in the pom.xml from 5.4.0.Final to 5.1.1 (already in there, just commented out) to verify this works in 5.1.1
--
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
More information about the jboss-jira
mailing list