How to fire pattern on partial match in Esper CEP

时间:2017-04-25 14:29:09

标签: esper epl complex-event-processing nesper

I'm trying to solve route-violation problem. User defines a route as series of location sequences (in exact order) that some item needs to be seen on. So lets say that correct route is (this is defined by user)

A -> B -> C

I'm trying to write Esper EPL which will fire on all route violations. A is a starting point, which needs to start a pattern (a valid location).

A -> !B -> !C

This will fire when there are all 3 types of events found in ESPER.

But what I want is also to fire when there is only partial combination like

A -> !B

or

!B -> !C

or

B -> !C

because if route is missed on B then I'll probably never come to C and will not be notified of route violation.

Is this even possible with patterns in Esper?

1 个答案:

答案 0 :(得分:1)

我可以看到一些选项。

  • 为每个
  • 注册一个带有模式或匹配识别的单独语句
  • 将每个人与"或"即"每个(..)或每个(..)或每个(..)
  • 将部分匹配的结果插入到另一个模式的流中以继续匹配
  • 我认为匹配识别有一些恢复选项围绕"跳过"