How to implement multi-event object association rules in drools cep - Stack Overflow

Please use Drools to write an association rule with the following requirements:There are four Event ob

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744709887a4589280.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信