![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
See Defining Tests in TIBCO Hawk Administrator’s Guide for more details.
1. In the Rule Editor window, click Create on the toolbar.
2. In the Test Editor window, the If field is for the test expression, which you create in the Test Builder window. You access this window by clicking Edit. The Then field is for one or more actions to perform if the test evaluates to true, which you specify in the Action Editor window. You access this window using toolbar buttons in the Test Editor window.
3. Figure 55 Creating a New TestThe first set of angle brackets contains the test expression. It consists of a parameter, a return value of the microagent method used as a data source, and a test operator, such as isTrue. Test operators you can use in an expression depend on the type of value returned by the microagent method. Numeric, string and Boolean values can all be used as input in a test expression.The following procedure shows how to build a test expression by specifying a test parameter and test operator in the Test Builder window. This example uses the BusinessConnect-zhezhang-dt-Interior-Server:name=GatewayInstance-192.168.69.105-11000 microagent _getinboundReceivedHTTP() method result field and a numeric operator.
1. Click inboundReceivedHTTP to use as the test parameter.inboundReceivedHTTP is returned by the _getinboundReceivedHTTP() method, the data source for this rule. The text area in the Microagents, Methods and Arguments window displays a short description of each parameter. In the description for this method, you can see that inboundReceivedHTTP is a double value.
2. Click > in the Operator field. Only operators that apply to the current parameter are included in the list. inboundReceivedHTTP is a double value, so numeric operators are listed.
3.
4. Click OK to save the test expression.This test checks the HTTP inbound value of the Gateway Instance. If the value is less than 1000, no problem occurs and the test is false. Since the _getinboundReceivedHTTP() is a synchronous method, the agent evaluates the test every 60 seconds by default.See Building a Test Expression in TIBCO Hawk Administrator’s Guide for more details.A compound test uses the same operators as a simple test, but allows you to combine multiple expressions using the logical operators AND, NOT, and OR. You can group expressions and insert operators in the compound test editor.The following procedure shows how to build a compound test expression by modifying a simple expression. This example adds a second condition, using the BusinessConnect-zhezhang-dt-Interior-Server:name=GatewayInstance-192.168.69.105-11000 microagent _getinboundReceivedHTTP() method result field and a text string operator, to the sample test expression on page 292. Both conditions in the new test expression must be satisfied for the test to evaluate to true.
1. In the Test Editor window, click Compound. The current text expression is highlighted in the Test Expression field, for example:This test checks for the inboundReceivedHTTP value is greater than a specific number.
2. Click And to group the highlighted expression and add the AND operator. The compound test editor automatically adds the correct number of parentheses to the expression:Figure 56 Building a Compound Test
3. In the lower half of the window, click inboundReceivedHTTP in the Parameter field and the < in the Operator field.
4.
5. Click Apply to insert the expression into the highlighted set of parentheses. The compound test now looks like the following:This test evaluates to true when the specified value in the inboundReceivedHTTP process is greater than 1000, and less than 2000. If the threshold is exceeded, the test triggers an action for restarting the process and notifying the system administrator. For more information, see Defining Actions.
6. A test includes the test expression, such as inboundReceivedHTTP > 10 and any extra conditions, for example, counters, timers and additional tests. These advanced options add extra requirements for a test to be evaluated as true or false.
To access advanced test options, see Using Advanced Test Features in TIBCO Hawk Administrator’s Guide for more details.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |