Interface Behavior

    • Method Detail

      • createContext

        Behavior.Context createContext()
        Creates the context object associated with this behavior. The object is given as a parameter in all behavior call backs.
      • assertFact

        boolean assertFact​(Object context,
                           InternalFactHandle fact,
                           PropagationContext pctx,
                           ReteEvaluator reteEvaluator)
        Makes the behavior aware of the new fact entering behavior's scope
        Parameters:
        context - The behavior context object
        fact - The new fact entering behavior's scope
        reteEvaluator - The working memory session reference
        Returns:
        true if the propagation should continue, false otherwise. I.e., the behaviour has veto power over the fact propagation, and prevents the propagation to continue if returns false on this method.
      • retractFact

        void retractFact​(Object context,
                         InternalFactHandle fact,
                         PropagationContext pctx,
                         ReteEvaluator reteEvaluator)
        Removes a right tuple from the behavior's scope
        Parameters:
        context - The behavior context object
        fact - The fact leaving the behavior's scope
        reteEvaluator - The working memory session reference
      • getExpirationOffset

        long getExpirationOffset()
        Some behaviors might change the expiration offset for the associated fact type. Example: time sliding windows. For these behaviors, this method must return the expiration offset associated to them.
        Returns:
        the expiration offset for this behavior or -1 if they don't have a time based expiration offset.