Use the New Rule properties window: Implementation tab to define the manner in which the rule is implemented.
Note: The rule contains the data, but it does not perform the implementation. Rather, the Java rule implementor implements the rule.
For example, suppose you want to create a rule that determines whether a given person is a senior citizen, 62 years old or older. To implement this rule, give the "com.ibm.websphere.brb.implementor.RuleGreaterThanEqual" Java rule implementor the value 62 and specify it as an initialization parameter. When the application fires the rule, the person's age is passed to the Java rule implementor as a firing parameter and 62 is passed as an initialization parameter. The person's age is compared against the initialization parameter of 62 and a value of true or false is returned from the Java rule implementor to the application. To change the age at which a person is considered a senior citizen, change the value of the initialization parameter.
The following fields and options are available on this tab:
(Required) Use the Java rule implementor field to specify a class to implement this rule. The initialization and firing parameters that are required are determined by looking at the documentation for the specified Java rule implementor.
Use the Firing location field to determine where the rule is fired. You can fire the Java rule implementor on the server where the rules exist or fire it locally on the client machine. The client can be a servlet running on the server. Specify one of the following values for the firing location:
To choose the value of the firing location, you must take both performance and maintenance into consideration. Most rules perform better if they are run on the same Java virtual machine (JVM) as the application (locally). However, there might be cases where a Java rule implementor performs server-intensive tasks, in which case the rules might run better when they run on the server. To run locally, you must have all of the Java rule implementors installed locally. They must be accessible by the application that fires the rules.
The initialization parameters contain constant values passed to the rule implementor when it is initialized. Typically, the initialization parameters contain values that might change as your business practices evolve, such as the age at which a person is considered a senior citizen or the current interest rate for a loan.
To add a new initialization parameter to the list, click Add and fill in the fields in the Add Initialization Parameter window.
To edit an existing initialization parameter, highlight it, click Change, and fill in the fields in the Change Initialization Parameter window.
To delete an initialization parameter, highlight it and click Delete.
To change the order of the initialization parameters, highlight one and click the up or down arrows to move it to a new location.
The firing parameters contain values passed from the trigger point in the application to the Java rule implementor at run time. You can alter the parameters coming from the application before passing them to the Java rule implementor. Typically, these parameters are left unaltered.
For example, when implementing the "isSeniorCitizen" rule that determines whether a person is a senior citizen, you might want to pass a person from the application to the rule as the target object. However, the "isSeniorCitizen" rule uses the RuleGreaterThanEqual Java rule implementor, which requires that you pass an integer value. You can alter the firing parameters to specify that the method "getAge" is called on the person object and pass that result to the Java rule implementor.
You must choose one of the following options:
To add a new firing parameter to the list, click Add and fill in the fields in the Add Firing Parameter window.
To edit an existing firing parameter, highlight the firing parameter, click Change, and fill in the fields in the Change Firing Parameter window.
To delete a parameter, highlight the firing parameter and click Delete.
To change the order of the firing parameters, highlight one and click the up or down arrows to move it to a new location.