且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在哪里可以查看规则失败的模式?

更新时间:2022-03-17 09:46:09

。由于Drools在内部使用了算法,因此模式被分解为节点,并且节点可以在知识库中的多个规则之间共享。如果您真的需要知道为什么某个规则不被执行,则可以创建其他规则来告诉您。在您的示例中,您可以创建以下内容:

You can't. Because of the algorithm Drools uses internally, patterns are decomposed into nodes and nodes can be shared among multiple rules in your knowledge base. If you really need to know why a rule was not fire, then you can create other rules that will tell you that. In your example, you could create something like this:

rule "No Trigger because of No D2"
agenda-group "Trigger"
salience 100
    when
        $pcase : PCaseMgr()

        D1($id: id, type != null, type == "AAA")
        not D2(aId == $id)

    then
        $pcase.printAnalyticsRuleLog(">>>>>>>>>>>>>>>>>>> No Trigger because no D2");
end

希望有帮助,