问题
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
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.
回答1:
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.
Hope it helps,
来源:https://stackoverflow.com/questions/51934097/drools-7-event-listener-to-whenever-a-rule-is-activated-even-if-partially-matc