Class TestingEventListener
- java.lang.Object
-
- org.drools.compiler.testframework.TestingEventListener
-
- All Implemented Interfaces:
EventListener,org.kie.api.event.rule.AgendaEventListener
public class TestingEventListener extends Object implements org.kie.api.event.rule.AgendaEventListener
This tracks what is happening in the engine with rule activations and firings. It also allows you to choose what to include/exclude from firing. If a rule is not allowed to fire, it will still be counted as an activation. If it is allowed to fire, then it will only be counted after the activation is fired.
-
-
Constructor Summary
Constructors Constructor Description TestingEventListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterMatchFired(org.kie.api.event.rule.AfterMatchFiredEvent event)voidafterRuleFlowGroupActivated(org.kie.api.event.rule.RuleFlowGroupActivatedEvent event)voidafterRuleFlowGroupDeactivated(org.kie.api.event.rule.RuleFlowGroupDeactivatedEvent event)voidagendaGroupPopped(org.kie.api.event.rule.AgendaGroupPoppedEvent event)voidagendaGroupPushed(org.kie.api.event.rule.AgendaGroupPushedEvent event)voidbeforeMatchFired(org.kie.api.event.rule.BeforeMatchFiredEvent event)voidbeforeRuleFlowGroupActivated(org.kie.api.event.rule.RuleFlowGroupActivatedEvent event)voidbeforeRuleFlowGroupDeactivated(org.kie.api.event.rule.RuleFlowGroupDeactivatedEvent event)org.kie.api.runtime.rule.AgendaFiltergetAgendaFilter(HashSet<String> ruleNames, boolean inclusive)Map<String,Integer>getFiringCounts()String[]getRulesFiredSummary()Return a list of the rules fired, for display purposes.voidmatchCancelled(org.kie.api.event.rule.MatchCancelledEvent event)voidmatchCreated(org.kie.api.event.rule.MatchCreatedEvent event)
-
-
-
Method Detail
-
getAgendaFilter
public org.kie.api.runtime.rule.AgendaFilter getAgendaFilter(HashSet<String> ruleNames, boolean inclusive)
-
matchCancelled
public void matchCancelled(org.kie.api.event.rule.MatchCancelledEvent event)
- Specified by:
matchCancelledin interfaceorg.kie.api.event.rule.AgendaEventListener
-
matchCreated
public void matchCreated(org.kie.api.event.rule.MatchCreatedEvent event)
- Specified by:
matchCreatedin interfaceorg.kie.api.event.rule.AgendaEventListener
-
afterMatchFired
public void afterMatchFired(org.kie.api.event.rule.AfterMatchFiredEvent event)
- Specified by:
afterMatchFiredin interfaceorg.kie.api.event.rule.AgendaEventListener
-
agendaGroupPopped
public void agendaGroupPopped(org.kie.api.event.rule.AgendaGroupPoppedEvent event)
- Specified by:
agendaGroupPoppedin interfaceorg.kie.api.event.rule.AgendaEventListener
-
agendaGroupPushed
public void agendaGroupPushed(org.kie.api.event.rule.AgendaGroupPushedEvent event)
- Specified by:
agendaGroupPushedin interfaceorg.kie.api.event.rule.AgendaEventListener
-
beforeMatchFired
public void beforeMatchFired(org.kie.api.event.rule.BeforeMatchFiredEvent event)
- Specified by:
beforeMatchFiredin interfaceorg.kie.api.event.rule.AgendaEventListener
-
getFiringCounts
public Map<String,Integer> getFiringCounts()
- Returns:
- A map of the number of times a given rule "fired". (of course in reality the side effect of its firing may have been nilled out).
-
getRulesFiredSummary
public String[] getRulesFiredSummary()
Return a list of the rules fired, for display purposes.
-
afterRuleFlowGroupActivated
public void afterRuleFlowGroupActivated(org.kie.api.event.rule.RuleFlowGroupActivatedEvent event)
- Specified by:
afterRuleFlowGroupActivatedin interfaceorg.kie.api.event.rule.AgendaEventListener
-
afterRuleFlowGroupDeactivated
public void afterRuleFlowGroupDeactivated(org.kie.api.event.rule.RuleFlowGroupDeactivatedEvent event)
- Specified by:
afterRuleFlowGroupDeactivatedin interfaceorg.kie.api.event.rule.AgendaEventListener
-
beforeRuleFlowGroupActivated
public void beforeRuleFlowGroupActivated(org.kie.api.event.rule.RuleFlowGroupActivatedEvent event)
- Specified by:
beforeRuleFlowGroupActivatedin interfaceorg.kie.api.event.rule.AgendaEventListener
-
beforeRuleFlowGroupDeactivated
public void beforeRuleFlowGroupDeactivated(org.kie.api.event.rule.RuleFlowGroupDeactivatedEvent event)
- Specified by:
beforeRuleFlowGroupDeactivatedin interfaceorg.kie.api.event.rule.AgendaEventListener
-
-