问题描述
我正在使用Drools 7.8和处理事件。
I'm using Drools 7.8 and DefaultAgendaEventListener to handle events.
我正在尝试在激活规则后处理事件(即使部分匹配),但到目前为止,该类处理的每个事件都失败了。例如,假设我有以下规则:
I'm trying to handle the event when a rule is activated (even if it was partially matched) but have failed so far with every one of the events handled by that class. For example let´s say i have this rule:
rule "A"
when
ConditionA
ConditionB
ConditionC
then
Consequence
end
我希望在满足这三个条件(A,B或C)中的任何一个条件时处理事件,即使结果没有触发,但很难在Drools文档中找到正确的方法来实现。
I want to handle the event when any of those 3 conditions (A,B or C) is met, even if the consequence is not fired but it's been hard to find the correct way to do this in Drools docs.
推荐答案
基本上,您不能这样做。 Drools不会创建部分匹配。规则是否匹配。
Basically, you can't do that. Drools doesn't create "partial" matches. A rule is either matched or not.
您可以尝试使用,以创建较小的规则,但我之前从未尝试过。
You could try to do something with named consequences, to kind of create smaller rules, but I've never tried this before.
希望有帮助,
这篇关于Drools 7,事件侦听器,无论何时激活规则(即使部分匹配)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!