The example Java source files in examples/rulebase_api show how to use the Rulebase-related classes of the Configuration Object API.
This sample shows how to create a simple rulebase and save it to a file. The rulebase uses the Spot microagent that is created using the provided sample application.
In the rulebase, the data source is the current color of the Spot microagent. The test in the rulebase checks the color of the Spot microagent. If the color is blue, it performs an action that changes the color to green.
This sample extends RBIsample1.java to show how to use a compound test in a rulebase.
In this example, the rulebase created in RBIsample1.java is save to a file. After reading the rulebase from the file,
RBIsample2.java replaces the test with a compound test. The compound test checks if the current color is either blue or red. If this condition is satisfied, it performs an action that changes the color to green.
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
Appendix A, 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.