com.ibm.websphere.brb.implementor
Class RuleConstant

java.lang.Object
  |
  +--com.ibm.websphere.brb.implementor.RuleConstant
All Implemented Interfaces:
RuleImplementor

public class RuleConstant
extends java.lang.Object
implements RuleImplementor

Derivation rule which simply returns a persistent constant.


Constructor Summary
RuleConstant()
           
 
Method Summary
 java.lang.Object fire(TriggerPoint tp, java.lang.Object target, IRuleCopy rule, java.lang.Object[] firingParams)
          If an initialization parameter was provided, then that value is returned.
 java.lang.String getDescription()
          The programmer's description of what the algorithm does.
 void init(java.lang.Object[] parms, java.lang.String[] dependentRules, java.lang.String userDefinedData, IRuleCopy rule)
          Initializes constants used by this rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleConstant

public RuleConstant()
Method Detail

fire

public java.lang.Object fire(TriggerPoint tp,
                             java.lang.Object target,
                             IRuleCopy rule,
                             java.lang.Object[] firingParams)
                      throws BusinessRuleBeansException
If an initialization parameter was provided, then that value is returned. If there was no initialization parameter, then the single firing parameter is returned.
Specified by:
fire in interface RuleImplementor
Following copied from interface: com.ibm.websphere.brb.RuleImplementor
Parameters:
tp - the trigger point which is firing this rule implementor.
target - the target object of the trigger point
rule - the rule that the implementor is running on behalf of
firingParams - the firing parameters, i.e. those parameters that are passed to the BRBeans framework at the trigger point
Returns:
The result of firing the rule implementor. Implementors that carry out classifications must return a single String. Implementors which check constraints should generally return a ConstraintReturn, especially if the results are to be combined and returned by the BRBeans framework.
Throws:
com.ibm.brb.BusinessRuleBeansException - Thrown when an error condition is associated with the fired Rule implementation.

getDescription

public java.lang.String getDescription()
The programmer's description of what the algorithm does.
Specified by:
getDescription in interface RuleImplementor
Following copied from interface: com.ibm.websphere.brb.RuleImplementor
Returns:
A description of this rule implementor.

init

public void init(java.lang.Object[] parms,
                 java.lang.String[] dependentRules,
                 java.lang.String userDefinedData,
                 IRuleCopy rule)
          throws BusinessRuleBeansException
Initializes constants used by this rule. The single constant used by this rule can either be passed as the single initialization parameter or it can be passed as a firing parameter, in which case it has no initialization parameters.
Specified by:
init in interface RuleImplementor
Following copied from interface: com.ibm.websphere.brb.RuleImplementor
Parameters:
initParams - the parameters needed to initialize this RuleImplementor
dependentRules - the names of the dependent rules to this rule; if there are none, null is passed
userDefinedData - userDefinedData property from the Rule
rule - the Rule on whose behalf the rule implementor is running