Interface InternalAgenda

    • Method Detail

      • getWorkingMemory

        InternalWorkingMemory getWorkingMemory()
        Returns the WorkignMemory for this Agenda
        Returns:
        The WorkingMemory
      • setFocus

        void setFocus​(String name)
        Sets the Agenda's focus to the specified AgendaGroup
      • activateRuleFlowGroup

        void activateRuleFlowGroup​(String name)
        Activates the RuleFlowGroup with the given name. All activations in the given RuleFlowGroup are added to the agenda. As long as the RuleFlowGroup remains active, its activations are automatically added to the agenda.
      • activateRuleFlowGroup

        void activateRuleFlowGroup​(String name,
                                   long processInstanceId,
                                   String nodeInstanceId)
        Activates the RuleFlowGroup with the given name. All activations in the given RuleFlowGroup are added to the agenda. As long as the RuleFlowGroup remains active, its activations are automatically added to the agenda. The given processInstanceId and nodeInstanceId define the process context in which this RuleFlowGroup is used.
      • deactivateRuleFlowGroup

        void deactivateRuleFlowGroup​(String name)
        Deactivates the RuleFlowGroup with the given name. All activations in the given RuleFlowGroup are removed from the agenda. As long as the RuleFlowGroup remains deactive, its activations are not added to the agenda
      • focusStackSize

        int focusStackSize()
        Iterates all the AgendGroups in the focus stack returning the total number of Activations
        Returns:
        total number of Activations on the focus stack
      • agendaSize

        int agendaSize()
        Iterates all the modules in the focus stack returning the total number of Activations
        Returns:
        total number of activations on the focus stack
      • clearAndCancel

        void clearAndCancel()
        Clears all Activations from the Agenda
      • clearAndCancelAgendaGroup

        void clearAndCancelAgendaGroup​(String name)
        Clears all Activations from an Agenda Group. Any Activations that are also in an Xor Group are removed the the Xor Group.
      • clearAndCancelActivationGroup

        void clearAndCancelActivationGroup​(String name)
        Clears all Activations from an Activation-Group. Any Activations that are also in an Agenda Group are removed from the Agenda Group.
      • clearAndCancelActivationGroup

        void clearAndCancelActivationGroup​(InternalActivationGroup activationGroup)
        Clears all Activations from an Activation Group. Any Activations that are also in an Agenda Group are removed from the Agenda Group.
      • clearAndCancelRuleFlowGroup

        void clearAndCancelRuleFlowGroup​(String name)
      • getFocusName

        String getFocusName()
        Returns the name of the agenda group that currently has the focus
      • fireNextItem

        int fireNextItem​(org.kie.api.runtime.rule.AgendaFilter filter,
                         int fireCount,
                         int fireLimit)
      • cancelActivation

        void cancelActivation​(Activation activation)
      • modifyActivation

        void modifyActivation​(AgendaItem activation,
                              boolean previouslyActive)
        Adds the activation to the agenda. Depending on the mode the agenda is running, the activation may be added to the agenda priority queue (synchronously or asynchronously) or be executed immediately.
      • isDeclarativeAgenda

        boolean isDeclarativeAgenda()
      • isRuleInstanceAgendaItem

        boolean isRuleInstanceAgendaItem​(String ruleflowGroupName,
                                         String ruleName,
                                         long processInstanceId)
        Returns true if there is at least one activation of the given rule name in the given ruleflow group name
      • fireAllRules

        int fireAllRules​(org.kie.api.runtime.rule.AgendaFilter agendaFilter,
                         int fireLimit)
        Fires all activations currently in agenda that match the given agendaFilter until the fireLimit is reached or no more activations exist.
        Parameters:
        agendaFilter - the filter on which activations may fire.
        fireLimit - the maximum number of activations that may fire. If -1, then it will fire until no more activations exist.
        Returns:
        the number of rules that were actually fired
      • halt

        void halt()
        Stop agenda from firing any other rule. It will finish the current rule execution though.
      • fireUntilHalt

        void fireUntilHalt()
        Keeps firing activations until a halt is called. If in a given moment, there is no activation to fire, it will wait for an activation to be added to an active agenda group or rule flow group.
      • fireUntilHalt

        void fireUntilHalt​(org.kie.api.runtime.rule.AgendaFilter agendaFilter)
        Keeps firing activations until a halt is called. If in a given moment, there is no activation to fire, it will wait for an activation to be added to an active agenda group or rule flow group.
        Parameters:
        agendaFilter - filters the activations that may fire
      • isAlive

        boolean isAlive()
      • reset

        void reset()
      • getAgendaGroup

        AgendaGroup getAgendaGroup​(String name)
        Specified by:
        getAgendaGroup in interface org.kie.api.runtime.rule.Agenda
      • removeAgendaGroup

        void removeAgendaGroup​(String name)
      • getActivationGroup

        InternalActivationGroup getActivationGroup​(String name)
        Specified by:
        getActivationGroup in interface org.kie.api.runtime.rule.Agenda
      • getRuleFlowGroup

        RuleFlowGroup getRuleFlowGroup​(String name)
        Specified by:
        getRuleFlowGroup in interface org.kie.api.runtime.rule.Agenda
      • setActivationsFilter

        void setActivationsFilter​(ActivationsFilter filter)
        Sets a filter that prevents activations from being added to the agenda.
      • getActivationsFilter

        ActivationsFilter getActivationsFilter()
        Returns the current activations filter or null if none is set
      • isFiring

        boolean isFiring()
      • executeFlush

        void executeFlush()
      • activate

        void activate()
      • deactivate

        void deactivate()
      • tryDeactivate

        boolean tryDeactivate()
      • insertAndStageActivation

        void insertAndStageActivation​(AgendaItem activation)
      • addEagerRuleAgendaItem

        void addEagerRuleAgendaItem​(RuleAgendaItem item)
      • removeEagerRuleAgendaItem

        void removeEagerRuleAgendaItem​(RuleAgendaItem item)
      • addQueryAgendaItem

        void addQueryAgendaItem​(RuleAgendaItem item)
      • removeQueryAgendaItem

        void removeQueryAgendaItem​(RuleAgendaItem item)
      • setFocus

        boolean setFocus​(AgendaGroup agendaGroup)
      • addAgendaGroupOnStack

        void addAgendaGroupOnStack​(AgendaGroup agendaGroup)
      • evaluateEagerList

        void evaluateEagerList()
      • sizeOfRuleFlowGroup

        int sizeOfRuleFlowGroup​(String s)
      • addItemToActivationGroup

        void addItemToActivationGroup​(AgendaItem item)
      • isRuleActiveInRuleFlowGroup

        boolean isRuleActiveInRuleFlowGroup​(String ruleflowGroupName,
                                            String ruleName,
                                            long processInstanceId)
      • flushPropagations

        void flushPropagations()
      • notifyWaitOnRest

        void notifyWaitOnRest()
      • hasPendingPropagations

        boolean hasPendingPropagations()
      • isParallelAgenda

        boolean isParallelAgenda()