Esper - 我们可以使用 esper 进行流水线时尚处理吗?

Esper - Can we do pipelined fashion processing using esper?

我想使用 Esper 以流水线方式进行一些事件处理。我需要为每个事件检查多个案例。 例如,我想 运行 针对以下情况输入的数据。我该怎么做?最好的方法是什么?

案例 1 = "If the current level is 400% greater than the average of last 5 consecutive values then mark the event with Exception-1"
案例 2 = "If the current level value is null then mark as Exception-2"
案例 3 = "If case 2 and case 3 are not matched, then the data is marked as 'safe'"

以下是我想要做的粗略表示

     if (case1) { 
       mark with Exception 1 
     }

     if (case2) {
       mark with Exception 2 
     }

     if (none of the above cases matches) {
         mark as safe 
     }

像这样

on Event 
insert into OutputStream select 'Exception 1' as label, * where level_detected > 400
insert into OutputStream select 'Exception 2' as label, * where level_detected = null
insert into OutputStream select 'safe' as label, *

您没有询问如何对 "If the current level is 400% greater than the average of last 5 consecutive values" 进行检测,所以这不是我的回答的一部分。

Esper docs for split stream