admin管理员组文章数量:1391947
Please use Drools to write an association rule with the following requirements: There are four Event objects A, B, C, and D that arrive within a time window of 10 seconds, and in no particular order (random order). In Flink streaming processing, the processing mode is:
KieHelper kieHelper = new KieHelper();
kieHelper.addContent(drl, ResourceType.DRL);
KieServices kieServices = KieServices.Factory.get();
KieBaseConfiguration config = KieServices.Factory.get().newKieBaseConfiguration();
config.setOption(EventProcessingOption.STREAM);
class Event {
int a;
int b;
int c;
int d;
}
Conditions to be met:
When event A arrives, A.a>100 is satisfied
When event B arrives, B.b<100 is satisfied
When event C arrives, C.c>20 is satisfied
When event D arrives, D.d==10 is satisfied
The associated conditions must be met:
A.b==C.d && B.a==D.c
If the above conditions are met within the time window of 10 seconds, the alarm rule will be triggered. Please write the rule below, requiring high performance under streaming processing.
I tried to use drools cep grammar rules to write such a rule, but failed. I hope the experts in the forum can help me write this multi-event association rule. Thank you.
本文标签: How to implement multievent object association rules in drools cepStack Overflow
版权声明:本文标题:How to implement multi-event object association rules in drools cep - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744709886a2621066.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论