Rule management APIs

Business Rule Beans (BRBeans) provide 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 enterprise beans. Use these APIs to perform rule management tasks instead of coding directly in the EJB interfaces.

The rule management APIs consist of the classes in the com.ibm.websphere.brb.mgmt package. You might use the following main classes:

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 in the IRuleFolder interface since you must always create a rule and specify a particular folder in which it will reside. In the rule management APIs, any time you get a rule, you have the option to receive a reference to the enterprise bean itself or to receive a local copy of the data contained in the enterprise beans. Regardless of which option you choose, 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 the IRuleCopy section for more details.

IRuleCopy

This is the interface used to access a local copy of the enterprise bean that represents 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 is much faster than calling the method on the actual enterprise bean. 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 enterprise bean 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 enterprise bean.

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 within 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 that are accessible from this interface. The following classes are provided to implement the IParameter interface:

ConstantParameter
This is the most common type of parameter. It represents a single constant value that is to be passed as an initialization or firing parameter.
MethodCallParameter
This class represents a parameter whose value is determined by calling a method on the target object. The method to call must be a public method and must take zero parameters. This is only used for firing parameters.
TriggerPointParameter
This class represents a parameter that is retrieved from one of the trigger point firing parameters. This is mainly used for reordering the firing parameters passed on the trigger point. This is only used for firing parameters.
For more details on the rule management interfaces, including a number of coding examples, refer to the com.ibm.websphere.brb.mgmt package in the BRBeans Javadoc.


Related concepts
Overview of Business Rule Beans
Rule Management Application



Searchable topic ID:   rbrb_api
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/brb/ref/rbrb_api.html

Library | Support | Terms of Use | Feedback