Class ActivationLogEvent


  • public class ActivationLogEvent
    extends LogEvent
    An activation event logged by the WorkingMemoryLogger. It is a snapshot of the event as it was thrown by the working memory. It contains the activation id, the name of the rule and a String representing the declarations of the activation, which is a list of name-value-pairs for each of the declarations in the tuple of the activation. The name is the identifier (=name) of the declaration, and the value is a toString of the value of the parameter, followed by the id of the fact between parentheses. e.g. param1=10; param2=Person[John Doe] Such a String representation is used to create a snapshot of the current state of the activation by storing a toString of the facts bound in the activation. If necessary, this event could be extended to contain a map of declarations too.
    • Constructor Detail

      • ActivationLogEvent

        public ActivationLogEvent()
      • ActivationLogEvent

        public ActivationLogEvent​(int type,
                                  java.lang.String activationId,
                                  java.lang.String rule,
                                  java.lang.String declarations,
                                  java.lang.String ruleFlowGroup,
                                  java.lang.String factHandleIds)
        Create a new activation log event.
        Parameters:
        type - The type of event. This can only be ACTIVATION_CREATED, ACTIVATION_CANCELLED, BEFORE_ACTIVATION_FIRE or AFTER_ACTIVATION_FIRE.
        activationId - The id of the activation
        rule - The name of the rule of the activation
        declarations - A String representation of the declarations in the activation.
    • Method Detail

      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Overrides:
        readExternal in class LogEvent
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Overrides:
        writeExternal in class LogEvent
        Throws:
        java.io.IOException
      • getActivationId

        public java.lang.String getActivationId()
        Returns a unique id for the activation.
        Returns:
        The id of the activation
      • getRule

        public java.lang.String getRule()
        Returns the name of the rule of the activation.
        Returns:
        The name of the rule
      • getDeclarations

        public java.lang.String getDeclarations()
        Returns a String representation of the declarations in the activation.
        Returns:
        A String representation of the declarations.
      • getRuleFlowGroup

        public java.lang.String getRuleFlowGroup()
      • getFactHandleIds

        public java.lang.String getFactHandleIds()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object