[jboss-jira] [JBoss JIRA] (JBRULES-3558) Odd rules execution for expired events
Karol Sobczak (JIRA)
jira-events at lists.jboss.org
Mon Jun 25 03:50:12 EDT 2012
[ https://issues.jboss.org/browse/JBRULES-3558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Karol Sobczak updated JBRULES-3558:
-----------------------------------
Description:
I have declared two types:
declare Motion
@role( event )
@expires( 5s )
@timestamp( eventTime )
eventTime : long
end
declare Recording
end
and following rules:
rule "StartRecording"
when
Motion()
not Recording()
then
insert(new Recording())
end
the problem is that when I put a lot of "Motions", sleep (so "Motions" become expired) and then do fireAllRules(), I got "StartRecording" executed multiple times (and not only once), event though "Recording" is inserted every time.
Another issue would be when instead of "StartRecording" rule I would have "StopRecording" rule:
rule "StopRecording"
when
$m : Motion()
$r : Recording()
then
System.err.println("Recording: " + $r);
retract($r);
end
then when there is a "Recording" fact inserted and multiple expired "Motions", the rule would be executed multiple times (when "Motions" expire) and $r would be null after the first "StopRecording" rule execution.
was:
I have declared two types:
declare Motion
@role( event )
@expires( 5s )
@timestamp( eventTime )
eventTime : long
end
declare Recording
end
and following rules:
rule "StartRecording"
when
Motion()
not Recording()
then
insert(new Recording())
end
the problem is that when I put a lot of "motions", sleep (so "motions" become expired) and then do fireAllRules(), I got "StartRecording" executed multiple times (and not only once), event though Recording is inserted every time.
Forum Reference: http://drools.46999.n3.nabble.com/Odd-rules-execution-for-expired-events-tt4018092.html (was: http://drools.46999.n3.nabble.com/Odd-rules-execution-for-expired-events-tt4018092.html)
> Odd rules execution for expired events
> --------------------------------------
>
> Key: JBRULES-3558
> URL: https://issues.jboss.org/browse/JBRULES-3558
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-core (fusion)
> Affects Versions: 5.4.0.Final
> Environment: Windows Vista 64, JRE6 (x86)
> Reporter: Karol Sobczak
> Assignee: Mark Proctor
> Attachments: expiredrules.zip
>
>
> I have declared two types:
> declare Motion
> @role( event )
> @expires( 5s )
> @timestamp( eventTime )
> eventTime : long
> end
> declare Recording
> end
> and following rules:
> rule "StartRecording"
> when
> Motion()
> not Recording()
> then
> insert(new Recording())
> end
> the problem is that when I put a lot of "Motions", sleep (so "Motions" become expired) and then do fireAllRules(), I got "StartRecording" executed multiple times (and not only once), event though "Recording" is inserted every time.
> Another issue would be when instead of "StartRecording" rule I would have "StopRecording" rule:
> rule "StopRecording"
> when
> $m : Motion()
> $r : Recording()
> then
> System.err.println("Recording: " + $r);
> retract($r);
> end
> then when there is a "Recording" fact inserted and multiple expired "Motions", the rule would be executed multiple times (when "Motions" expire) and $r would be null after the first "StopRecording" rule execution.
--
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