如果发生了几个不同的事件,则触发动作

时间:2018-06-22 06:37:31

标签: java drools rule-engine

如果系统中发生了两个事件,我想触发一个动作。

目前,我提出了以下规则:

rule "if there are two events trigger another one"
    when
        $e1: Event(type == "Reconnaissance", name == "first")
        $e2: Event(type == "Authentication", name == "second")
    then
        System.out.println("Action called");
        insert(new Event(...));
    end

我可能读错了该信息,因为我看到两个事件都被其他规则触发,但是它们并未触发此规则。

如何实现?我应该在这里添加一些时间/窗口约束吗?

0 个答案:

没有答案