All Implemented Interfaces:
Cloneable

public class Test extends RulebaseElement
Test objects define the tests which are performed on the rule's data and what actions to take. A Test object consists primarilly of a test expresssion and a list of actions.
  • Field Details

    • CNAME

      public static String CNAME
  • Constructor Details

    • Test

      public Test(ConsequenceAction[] actions, Operator Op) throws IllegalArgumentException
      Constructs a Test object
      Parameters:
      actions - the test's consequence actions
      op - the Operator object forming the test expression, must be an Operator object that returns a Boolean value.
      Throws:
      IllegalArgumentException - if either argument is null
      IllegalArgumentException - if the test expression operator doesn't return a Boolean value;
    • Test

      public Test(COM.TIBCO.hawk.util.xml.XmlElementNode xmlNode) throws RulebaseException
      Constructs a Test
      Parameters:
      xmlNode - XML node that contain the DataSource
      Throws:
      RulebaseException
      See Also:
      • XmlElementNode
  • Method Details

    • getTestExpressionOperator

      public Operator getTestExpressionOperator()
      Returns the test expression operator.
    • isConverted

      public boolean isConverted()
    • setTestExpressionOperator

      public void setTestExpressionOperator(Operator op) throws IllegalArgumentException
      Sets the test expression operator.
      Parameters:
      op - the Operator object forming the test expression, must be an Operator object that returns a Boolean value.
      Throws:
      IllegalArgumentException - if op is null
      IllegalArgumentException - if the test expression operator doesn't return a Boolean value;
    • getConsequenceActions

      public ConsequenceAction[] getConsequenceActions()
      Returns the consequence actions.
    • getClearActions

      public ClearAction[] getClearActions()
      Returns the clear actions.
    • getTrueConditionPolicy

      public TrueConditionPolicy getTrueConditionPolicy()
      Returns the true condition policy
    • getClearConditionPolicy

      public ClearConditionPolicy getClearConditionPolicy()
      Returns the clear condition policy
    • setClearActions

      public void setClearActions(ClearAction[] clearActions)
      Sets the clear actions.
      Parameters:
      actions - the array of conequence actions, all actions must have unique names
      Throws:
      IllegalArgumentException - if the actions do not have unique names
    • setConsequenceActions

      public void setConsequenceActions(ConsequenceAction[] actions) throws IllegalArgumentException
      Sets the consequence actions.
      Parameters:
      actions - the array of conequence actions, all actions must have unique names
      Throws:
      IllegalArgumentException - if actions is null
      IllegalArgumentException - if the actions do not have unique names
    • setTrueConditionPolicy

      public void setTrueConditionPolicy(TrueConditionPolicy policy) throws IllegalArgumentException
      Sets the true condition policy. The only supported TrueConditionPolicy type is TrueCountThreshold.
      Parameters:
      policy - the true condition policy
      Throws:
      IllegalArgumentException - if policy is null
      IllegalArgumentException - if policy is not supported.
    • setClearConditionPolicy

      public void setClearConditionPolicy(ClearConditionPolicy policy) throws IllegalArgumentException
      Sets the clear condition policy The only supported ClearConditionPolicy types are ClearOnFirstFalse, ClearTimer, and ClearTest
      Parameters:
      policy - the clear condition policy
      Throws:
      IllegalArgumentException - if policy is null
      IllegalArgumentException - if policy is not supported.
    • toString

      public String toString()
      Returns string representation of this test.
      Overrides:
      toString in class Object
      Returns:
      the name of the test
    • equals

      public boolean equals(Object obj)
      Compares two Tests for equality.
      Overrides:
      equals in class RulebaseElement
      Returns:
      true if the objects are the same; false otherwise
    • clone

      public Object clone()
      Returns a copy of this object
      Specified by:
      clone in class RulebaseElement
    • getDefaultName

      protected String getDefaultName()
      Returns the default name for this ClearAction element. This is a generated name so that if the name of this ClearAction is not given, this method will provide one.
    • fillPostedConditionsUsed

      protected void fillPostedConditionsUsed(Vector v, Object[] operands)
      fill all posted conditions used in this test in a vector.
    • getPostedConditionsUsed

      protected String[] getPostedConditionsUsed()
      Returns list of all posted condition used in this test .
    • fillPostedConditionsAssigned

      protected void fillPostedConditionsAssigned(Vector v, ConsequenceAction[] actions)
      fill all assigned posted condition in this test in a vector.
    • getPostedConditionsAssigned

      protected String[] getPostedConditionsAssigned()
      Returns list of all posted condition assigned (invoke in action) in this test .
    • toXML

      protected void toXML(COM.TIBCO.hawk.util.xml.XmlWriter out) throws IOException, RulebaseException
      Write XML representation of the test to the XML writer.
      Overrides:
      toXML in class RulebaseElement
      Parameters:
      out - the XML writer where the output will be written.
      Throws:
      IOException
      RulebaseException
    • fromXML

      protected void fromXML(COM.TIBCO.hawk.util.xml.XmlElementNode node) throws RulebaseException
      Read XML representation of the test from the XML node.
      Overrides:
      fromXML in class RulebaseElement
      Parameters:
      node - the XML node containing the test operator.
      Throws:
      RulebaseException
      See Also:
      • XmlElementNode
    • performEventLogMAConversion

      public COM.TIBCO.hawk.talon.MethodInvocation performEventLogMAConversion(COM.TIBCO.hawk.talon.MethodInvocation mi)
    • getConvertedString

      public String getConvertedString(String str)
    • convertEventLogMABasedOperator

      public Object[] convertEventLogMABasedOperator(Object[] items)