RBIsample3.java
This sample demonstrates how an application can create, add, update, and delete a rulebase dynamically on an agent using the Configuration Object API and Console API. Refer to Common Configuration Object API Methods, for methods related to communication between a Console application and the TIBCO Hawk agent.
When running this sample, the Spot microagent should also be running. This allows you to see the effect of the action performed by the rulebase after being updated on the TIBCO Hawk agent.
The sample performs the following steps:
|
1.
|
Creates a rulebase using the color of the SPOT microagent as the data source, which changes to green if the current color is blue. |
|
2.
|
Adds the created rulebase to the agent. |
|
3.
|
Changes the color of SPOT to blue. (At runtime, a few second after this call, the color on the Spot microagent will change to green due to the test in the rulebase.) |
|
4.
|
Retrieves the rulebase, modifies it to change the color of SPOT to green if the current color is either blue or red, and updates the rulebase on the agent. |
|
5.
|
Sets the color of SPOT on the agent to red. (At runtime, a few second later after this call, the color on the Spot microagent will change to green due to the test in the rulebase.) |
|
6.
|
Sets the color of SPOT on the agent to blue. (At runtime, a few second later after this call, the color on the Spot microagent should change to green due to the test in the rulebase.) |
|
7.
|
Deletes the rulebase from the agent. |