Hello everyone!

I need some help trying to implement a CEP Pattern.

This pattern detects if there are no messages from a device for two
consecutive days.
For this purpose, it checks that after receiving a measurement from a
device, no further measurement is received from the same device for 2 days.

This is its signature in Esper SQL:

insert into CommunicationError
> select a1.serialNumber as serialNumber
> from pattern [((every a1 = Measure) -> (timer:interval(2 days) and not a2
> = Measure(a2.serialNumber = a1.serialNumber)))]



The initial wanted behavior is: receive a1, then wait for 2 days, evaluate
if not a2 --> then the pattern is triggered.
Is there a way to code this using the CEP library? Or at least, if not with
this exact behavior, something similar?

I've been testing with a keyed stream by serialNumber and this pattern but
it doesn't work as expected

val getPattern: Pattern[Measure, Measure] =
> Pattern
> .begin[Measure]("a1-communication-error")
> .within(Time.minutes(3)) //this has been reduced for testing purposes
> .notFollowedBy("a2-communication-error")



Thank you so much always for your time and insights



*Ana Gómez González*

<http://twitter.com/angoglez> <https://www.linkedin.com/in/angoglez/>

Reply via email to