[rules-users] Odd rules execution for expired events

Wolfgang Laun wolfgang.laun at gmail.com
Wed Jun 20 08:25:48 EDT 2012


Complete code, please - especially the Java code showing how you
insert Motion facts and call fireAllRules.
-W



On 20/06/2012, sopel39 <napewnotrafi at gmail.com> wrote:
> Hi,
>
> 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.
>
> It seems that inserting new recording does not cancel expired activations.
> Is that correct? How to handle such situation correctly?
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Odd-rules-execution-for-expired-events-tp4018092.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list