![]() |
|
BRBeans provides a set of APIs to perform rule management tasks programmatically. These tasks include creating, deleting, and updating rules and folders. These APIs are provided to simplify the interaction with the BRBeans EJBs. Users should use these APIs to perform rule management tasks instead of coding directly to the EJB interfaces.
The rule management APIs consist of the classes in the com.ibm.websphere.brb.mgmt
package.
The main classes that users will be interested in are the following:
IRule
This is the interface used to access the object representing a business rule in BRBeans. It provides methods to read and update attributes of the rule, to delete the rule, and to make a copy of the rule. The methods to create rules are on the IRuleFolder interface since you must always create a rule into a particular folder. In the rule management APIs, any time you get a rule you have the option to get a reference to the EJB itself or to get a local copy of the data contained in the EJB. Regardless of which option is chosen, the IRule interface can be used to access the returned object. If a local copy is requested, it is possible to cast the returned object to an IRuleCopy. IRuleCopy extends IRule and adds a couple additional methods to those defined by IRule. See below for more details.
IRuleCopy
This is the interface used to access a local copy of the EJB representing a business rule. An object implementing this interface is returned from rule management API methods if you ask for a local copy of the rule. The main reason for requesting a local copy is performance. Calling a method on a local copy will be much faster than calling the method on the actual EJB. If you need to access several different rule attributes, this may make a big difference. Similarly, when updating a rule, all updates can be sent to the EJB in one method call instead of many. The individual set methods are called on the copy and then the updatePersistentRule method is called to actually send the updates to the EJB.
IRuleFolder
This is the interface used to access the object representing a rule folder. It provides methods to create, delete, and find rules and subfolders. It also provides methods to move and rename the folder, and to get the parent folder. The IRuleFolder representing the root folder is generally what you start with when performing rule management tasks. Once you have the root folder you can navigate up and down the folder hierarchy and access rules contained with the folders.
RuleMgmtHelper
This is a helper class intended to contain methods that are of general use for performing rule management tasks. Currently the only methods available are used to get the IRuleFolder representing the root folder. The root folder is normally the starting point for performing rule management tasks.
IParameter
This is the interface used to represent an initialization or firing parameter stored in a Rule EJB. Every parameter has a user description and a value. Methods are provided on this interface to access these. Three classes are provided that implement the IParameter interface:
For more details on the rule management interfaces, including a number of coding examples, refer to the BRBeans Javadoc
Related concepts... | |
Parent: The BRBeans framework - overview | |
Business Rule Beans - overview | |
Trigger Point Framework - overview | |
Rule Implementor Interface - overview | |
BRBeans framework runtime | |
Using the Rule Management Application - overview | |
Using the RuleImporter and the RuleExporter tools | |
View PDF file... | |
To view a PDF file containing this article and related articles, click: | |
![]() | |
![]() |