Re: [rules-users] Future events

2012-03-15 Thread Wolfgang Laun
You shouldn't base a streamed CEP application on time stamps dealt out
by various systems with clocks that aren't properly synchronized using
NTP or whatever. If your data doesn't conform to the very reasonable
premises of some system, your application will have to handle that.
(You can't tell the engineer to start the train just because your
clock is fast, right?)

window:time is based on the notion of CEP in real time, and the clock
of the machine running the engine reads, by definition, true Time. But
you can run the engine in cloud mode and reason over arbitrary
intervals, e.g., by inserting Inverval facts. True, you won't have
window:x any more, but from/accumulate and from/collect should
suffice.

-W




On 14/03/2012, lexsoto lexs...@gmail.com wrote:
 Well, yes that is how the engine works.  But should it work this way? Why
 fire the rule if not in the appropriate time window? This still looks wrong
 to me, as the intention of the rule is not observed.  On the per hand,  the
 engine does queue events in other scenarios, so it seems arbritrary.  Too
 bad because this would be a ver nice way to model scheduled events using the
 temporal operators.

 Thanks Edson

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Future-events-tp3826236p3827065.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Future events

2012-03-14 Thread lexsoto
Hello:

I have this rule:



An event is inserted that has a timestamp in the future, the rule is fired.
This looks like a bug, because the sliding time window has not yet met the
timestamp of the event.
I expect the rule to fire not immediately but only when the time reaches the
event time.

Is my assumption/understanding correct?


--
View this message in context: 
http://drools.46999.n3.nabble.com/Future-events-tp3826236p3826236.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Future events

2012-03-14 Thread Edson Tirelli
   An event represents something that already happened (past), so there is
no such thing as a future event. You can have a fact that represents
something that is scheduled to happen in the future, but that is not an
event, and it can change as it is just data. Events are immutable.

   For instance: airport. You can have a flight scheduled to leave tomorrow
at 08:00am, from gate B1. That schedule might change, because the flight
can be delayed, cancelled, change gates, etc. It is just a fact in your
system (e.g. ScheduledFlight). But when the flight actually departs the
gate, then the system can have an event like FlightDepartedFromGate() that
says the flight left the gate B1 at 08:02am. This is immutable, because it
registers something that happened.

   Edson

On Wed, Mar 14, 2012 at 1:44 PM, lexsoto lexs...@gmail.com wrote:

 Hello:

 I have this rule:



 An event is inserted that has a timestamp in the future, the rule is fired.
 This looks like a bug, because the sliding time window has not yet met the
 timestamp of the event.
 I expect the rule to fire not immediately but only when the time reaches
 the
 event time.

 Is my assumption/understanding correct?


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Future-events-tp3826236p3826236.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Future events

2012-03-14 Thread Edson Tirelli
   The reason is because the engine will not queue up events and wait for
the correct time to deal with them. The engine assumes events always
represent past times. But for past events, I am sure the window is
respected. If you have a rule that counts the number of events in the last
5 hours, an event that happened 5 hours and 1 minute ago will not be in the
total count.

   Edson

On Wed, Mar 14, 2012 at 4:58 PM, lexsoto lexs...@gmail.com wrote:

 Thanks Edson for your reply, however I am still not clear about why the
 rule
 is firing if the time stamp of the event falls outside the time window.
 This can happen, for example, if the event originates in a machine with
 clock slightly ahead. I think the problem also occurs if the time is in the
 past; I would not want  to take action on a future or old event.

 I understand that events are immutable, and I am not changing the event in
 any way.  However, I expect the sliding time window to be changing along
 with the system clock until it reaches the timestamp of the event.
 My question still unanswered, why is the rule firing outside its time
 window? Is there a way to make this work?  Any advice about how to address
 this use case?

 Thanks

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Future-events-tp3826236p3826759.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Future events

2012-03-14 Thread lexsoto
Well, yes that is how the engine works.  But should it work this way? Why
fire the rule if not in the appropriate time window? This still looks wrong
to me, as the intention of the rule is not observed.  On the per hand,  the
engine does queue events in other scenarios, so it seems arbritrary.  Too
bad because this would be a ver nice way to model scheduled events using the
temporal operators.  

Thanks Edson  

--
View this message in context: 
http://drools.46999.n3.nabble.com/Future-events-tp3826236p3827065.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users