Class Test
java.lang.Object
COM.TIBCO.hawk.config.rbengine.rulebase.RulebaseElement
COM.TIBCO.hawk.config.rbengine.rulebase.Test
- All Implemented Interfaces:
Cloneable
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTest(ConsequenceAction[] actions, Operator Op) Constructs a Test objectTest(COM.TIBCO.hawk.util.xml.XmlElementNode xmlNode) Constructs a Test -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a copy of this objectObject[]convertEventLogMABasedOperator(Object[] items) booleanCompares two Tests for equality.protected voidfillPostedConditionsAssigned(Vector v, ConsequenceAction[] actions) fill all assigned posted condition in this test in a vector.protected voidfillPostedConditionsUsed(Vector v, Object[] operands) fill all posted conditions used in this test in a vector.protected voidfromXML(COM.TIBCO.hawk.util.xml.XmlElementNode node) Read XML representation of the test from the XML node.Returns the clear actions.Returns the clear condition policyReturns the consequence actions.getConvertedString(String str) protected StringReturns the default name for this ClearAction element.protected String[]Returns list of all posted condition assigned (invoke in action) in this test .protected String[]Returns list of all posted condition used in this test .Returns the test expression operator.Returns the true condition policybooleanCOM.TIBCO.hawk.talon.MethodInvocationperformEventLogMAConversion(COM.TIBCO.hawk.talon.MethodInvocation mi) voidsetClearActions(ClearAction[] clearActions) Sets the clear actions.voidSets the clear condition policy The only supported ClearConditionPolicy types are ClearOnFirstFalse, ClearTimer, and ClearTestvoidsetConsequenceActions(ConsequenceAction[] actions) Sets the consequence actions.voidSets the test expression operator.voidSets the true condition policy.toString()Returns string representation of this test.protected voidtoXML(COM.TIBCO.hawk.util.xml.XmlWriter out) Write XML representation of the test to the XML writer.Methods inherited from class COM.TIBCO.hawk.config.rbengine.rulebase.RulebaseElement
fromXML, fromXML, getName, getSchedule, loadFromFile, saveToFile, setName, setSchedule, toXML, toXML
-
Field Details
-
CNAME
-
-
Constructor Details
-
Test
Constructs a Test object- Parameters:
actions- the test's consequence actionsop- the Operator object forming the test expression, must be an Operator object that returns a Boolean value.- Throws:
IllegalArgumentException- if either argument is nullIllegalArgumentException- if the test expression operator doesn't return a Boolean value;
-
Test
Constructs a Test- Parameters:
xmlNode- XML node that contain the DataSource- Throws:
RulebaseException- See Also:
-
XmlElementNode
-
-
Method Details
-
getTestExpressionOperator
Returns the test expression operator. -
isConverted
public boolean isConverted() -
setTestExpressionOperator
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 nullIllegalArgumentException- if the test expression operator doesn't return a Boolean value;
-
getConsequenceActions
Returns the consequence actions. -
getClearActions
Returns the clear actions. -
getTrueConditionPolicy
Returns the true condition policy -
getClearConditionPolicy
Returns the clear condition policy -
setClearActions
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
Sets the consequence actions.- Parameters:
actions- the array of conequence actions, all actions must have unique names- Throws:
IllegalArgumentException- if actions is nullIllegalArgumentException- if the actions do not have unique names
-
setTrueConditionPolicy
Sets the true condition policy. The only supported TrueConditionPolicy type is TrueCountThreshold.- Parameters:
policy- the true condition policy- Throws:
IllegalArgumentException- if policy is nullIllegalArgumentException- if policy is not supported.
-
setClearConditionPolicy
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 nullIllegalArgumentException- if policy is not supported.
-
toString
Returns string representation of this test. -
equals
Compares two Tests for equality.- Overrides:
equalsin classRulebaseElement- Returns:
- true if the objects are the same; false otherwise
-
clone
Returns a copy of this object- Specified by:
clonein classRulebaseElement
-
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
fill all posted conditions used in this test in a vector. -
getPostedConditionsUsed
Returns list of all posted condition used in this test . -
fillPostedConditionsAssigned
fill all assigned posted condition in this test in a vector. -
getPostedConditionsAssigned
Returns list of all posted condition assigned (invoke in action) in this test . -
toXML
Write XML representation of the test to the XML writer.- Overrides:
toXMLin classRulebaseElement- Parameters:
out- the XML writer where the output will be written.- Throws:
IOExceptionRulebaseException
-
fromXML
Read XML representation of the test from the XML node.- Overrides:
fromXMLin classRulebaseElement- 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
-
convertEventLogMABasedOperator
-