Interface InternalWorkingMemory

    • Method Detail

      • getAgenda

        InternalAgenda getAgenda()
        Description copied from interface: WorkingMemory
        Returns the Agenda for this WorkingMemory. While the WorkingMemory interface is considered public, the Agenda interface is more subject to change.
        Specified by:
        getAgenda in interface WorkingMemory
        Returns:
        the Agenda
      • getIdentifier

        long getIdentifier()
      • setIdentifier

        void setIdentifier​(long id)
      • setRuleRuntimeEventSupport

        void setRuleRuntimeEventSupport​(RuleRuntimeEventSupport workingMemoryEventSupport)
      • setAgendaEventSupport

        void setAgendaEventSupport​(AgendaEventSupport agendaEventSupport)
      • getNextPropagationIdCounter

        long getNextPropagationIdCounter()
      • getEntryPoint

        org.kie.api.runtime.rule.EntryPoint getEntryPoint​(String name)
      • getFactHandleByIdentity

        org.kie.api.runtime.rule.FactHandle getFactHandleByIdentity​(Object object)
        Looks for the fact handle associated to the given object by looking up the object IDENTITY (==), even if rule base is configured to AssertBehavior.EQUALITY.
        Specified by:
        getFactHandleByIdentity in interface WorkingMemory
        Specified by:
        getFactHandleByIdentity in interface WorkingMemoryEntryPoint
        Parameters:
        object -
        Returns:
        null if fact handle not found
      • getLock

        Lock getLock()
      • isSequential

        boolean isSequential()
      • getCalendars

        org.kie.api.runtime.Calendars getCalendars()
      • getTimerService

        TimerService getTimerService()
        Returns the TimerService instance (session clock) for this session.
        Returns:
      • getChannels

        Map<String,​org.kie.api.runtime.Channel> getChannels()
        Returns a map of channel Id->Channel of all channels in this working memory
        Returns:
      • getEntryPoints

        Collection<? extends org.kie.api.runtime.rule.EntryPoint> getEntryPoints()
      • startBatchExecution

        void startBatchExecution()
      • endBatchExecution

        void endBatchExecution()
      • startOperation

        void startOperation()
        This method must be called before starting any new work in the engine, like inserting a new fact or firing a new rule. It will reset the engine idle time counter. This method must be extremely light to avoid contentions when called by multiple threads/entry-points
      • endOperation

        void endOperation()
        This method must be called after finishing any work in the engine, like inserting a new fact or firing a new rule. It will reset the engine idle time counter. This method must be extremely light to avoid contentions when called by multiple threads/entry-points
      • getIdleTime

        long getIdleTime()
        Returns the number of time units (usually ms) that the engine is idle according to the session clock or -1 if it is not idle. This method is not synchronised and might return an approximate value.
        Returns:
      • getTimeToNextJob

        long getTimeToNextJob()
        Returns the number of time units (usually ms) to the next scheduled job
        Returns:
        the number of time units until the next scheduled job or -1 if there is no job scheduled
      • updateEntryPointsCache

        void updateEntryPointsCache()
      • prepareToFireActivation

        void prepareToFireActivation()
        This method is called by the agenda before firing a new activation to ensure the working memory is in a safe state to fire the activation.
      • activationFired

        void activationFired()
        This method is called by the agenda right after an activation was fired to allow the working memory to resume any activities blocked during activation firing.
      • getTotalFactCount

        long getTotalFactCount()
        Returns the total number of facts in the working memory, i.e., counting all facts from all entry points. This is an approximate value and may not be accurate due to the concurrent nature of the entry points.
        Returns:
      • flushPropagations

        void flushPropagations()
      • activate

        void activate()
      • deactivate

        void deactivate()
      • tryDeactivate

        boolean tryDeactivate()
      • removeGlobal

        void removeGlobal​(String identifier)
      • notifyWaitOnRest

        void notifyWaitOnRest()
      • cancelActivation

        void cancelActivation​(Activation activation,
                              boolean declarativeAgenda)
      • onSuspend

        default void onSuspend()
      • onResume

        default void onResume()