Question

I need to achieve a dynamic sliding window of length (5) where I have incoming flight statuses from various flights coming into one stream.

Based on the flight_id property from various flights - dynamic windows of length 5 have to be created at run time and its average speed has to be maintained individually.

This example in Drools Fusion does not work when I insert multiple flights with different flight ids and speeds into it - http://books.google.co.in/books?id=trrfxX8JCisC&pg=PA136&lpg=PA136&dq=flight+average+speed+example+drools+fusion&source=bl&ots=NpRv7D32Us&sig=6XbWtIQ2T1idGMQRU_hQZgmd8fc&hl=en&sa=X&ei=RBAUU92yIsLkiAenFg&ved=0CDIQ6AEwAQ#v=onepage&q=flight%20average%20speed%20example%20drools%20fusion&f=false

The window gets reset when it detects a new flight id.

Please let me know if there is a solution for this in Drools Fusion or Esper or any other open source CEP.

Thanks in advance.

Was it helpful?

Solution

The link does not work.

Can you perhaps clarify "dynamic windows" and "windows get reset"? It is not clear what that could mean.

In Esper I have found an example in the docs in "4.2.6.1. Distinct Events for the Initiating Condition" and rewrote this for you what may match the somewhat fuzzy requirements:

create context Flight initiated by distinct(flightId) FlightEVent 
  terminated after 5 seconds; // you don't mention when to throw a flight away
context Flight select avg(speed) from FlightEvent.win:length(5);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top