Class TrackingAgendaEventListener

  • All Implemented Interfaces:
    EventListener, org.kie.api.event.rule.AgendaEventListener

    public class TrackingAgendaEventListener
    extends org.kie.api.event.rule.DefaultAgendaEventListener
    AgendaEventListener to track fired rules. When rule is fired for the first time it's added to fired rules and when the rule fires afterwards the counter is incremented to make it possible to track how many times the rule was fired
    • Constructor Detail

      • TrackingAgendaEventListener

        public TrackingAgendaEventListener()
    • Method Detail

      • afterMatchFired

        public void afterMatchFired​(org.kie.api.event.rule.AfterMatchFiredEvent event)
        Specified by:
        afterMatchFired in interface org.kie.api.event.rule.AgendaEventListener
        Overrides:
        afterMatchFired in class org.kie.api.event.rule.DefaultAgendaEventListener
      • isRuleFired

        public boolean isRuleFired​(String rule)
        Return true if the rule was fired at least once
        Parameters:
        rule - - name of the rule
        Returns:
        true if the rule was fired
      • ruleFiredCount

        public int ruleFiredCount​(String rule)
        Returns number saying how many times the rule was fired
        Parameters:
        rule - - name ot the rule
        Returns:
        number how many times rule was fired, 0 if rule wasn't fired
      • rulesCount

        public int rulesCount()
        Returns:
        how many rules were fired
      • clear

        public void clear()
        Clears all the information