[Enterprise Extensions only]

Externalized business rules

The objects used to implement a business rule contain methods and attributes used by the BRBeans runtime and/or its administrative component. An externalized business rule is implemented as a pair of objects:

The Rule is an entity EJB that stores all the persistent data for the business rule. This is the object that the trigger point framework code actually deals with directly. When a trigger point is invoked, the internal framework code performs a query to find the Rule object(s) representing the business rules to be triggered. Once the Rules are found, the framework code determines where the Rule is to be invoked, either local to the trigger point or remotely on the application server. It then invokes the fire method on either the Rule EJB itself (for remote triggering) or on a local copy of the EJB (for local triggering) to perform the function of the business rule.

The class name of the business rule's RuleImplementor is stored persistently in the Rule. The RuleImplementor is a transient object (not managed by the application server) which the Rule instantiates and then uses to do the actual work. When the fire() method is called on the Rule object, the Rule object combines its persistent set of values with the parameters it received on invocation to create the parameter list for the RuleImplementor, then it invokes fire() on the RuleImplementor with this parameter list. The actual execution of the RuleImplementor algorithm can take place either remotely (within the application server where the BRBeans EJBs are installed) or locally (within the JVM where the trigger point was called).