|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A business rule; an object that encapsulates the highly time and context-dependent behavior needed to ensure that work done with the application conforms to current business practices. Rules can be in exactly one of four states at any particular time, based on the values in the start and end date fields:
When a Rule is first created it is marked as ready for use and will be found when
firing Rules. If the Rule is not complete and should not be found by BRBeans, mark the
Rule as not being ready for use by calling method setReady
passing
false
.
A Rule can be represented as both a Rule (a server-side representation) or as a RuleCopy (a client-side representation). This IRule interface is the parent interface of both types of Rules.
Field Summary | |
static int |
DATE_STATUS_EXPIRED
Status constant - the rule has expired. |
static int |
DATE_STATUS_IN_EFFECT
Status constant - the rule is currently in effect. |
static int |
DATE_STATUS_INVALID
Status constant - the rule has a start date that is after its end date. |
static int |
DATE_STATUS_NO_START_DATE
Status constant - the rule has no start date so it will never be in effect. |
static int |
DATE_STATUS_PENDING
Status constant - the rule is scheduled to take effect in the future. |
static int |
FIRE_ANYWHERE
FireLocation constant - Rules can be fired anywhere. |
static int |
FIRE_LOCAL
FireLocation constant - Rules must be fired on the client. |
static int |
FIRE_REMOTE
FireLocation constant - Rules must be fired on the server. |
static int |
TYPE_COPY
Return type constant - get a copy of the persistent Rule when creating or retrieving Rules. |
static int |
TYPE_REFERENCE
Return type constant - get a reference to the persistent Rule when creating or retrieving Rules. |
Method Summary | |
void |
addInitParameter(ConstantParameter initParameter)
Adds the given init parameter to the end of the list of init parameters. |
java.util.Vector |
checkRuleData()
Check for errors in the data for this rule. |
IRule |
copy(int ruleReturnType)
Creates a new rule initialized with the contents of this rule. |
void |
delete()
Deletes this rule. |
java.lang.Object |
fire(TriggerPoint tp,
java.lang.Object target,
java.lang.Object[] firingParams)
Fires this rule. |
java.lang.String |
getBusinessIntent()
Returns the business intent of this rule. |
java.lang.String |
getClassification()
Returns the classification of this rule. |
int |
getDateStatus()
Determine the rule's status. |
java.lang.String[] |
getDependentRules()
Returns the names of the dependent rules of this rule. |
java.lang.String |
getDescription()
Returns the description of this rule. |
java.util.Date |
getEndDate()
Returns the date when this rule expires. |
int |
getFiringLocation()
Returns the firing location for this rule. |
IParameter[] |
getFiringParameters()
Returns the firing parameters for this rule. |
java.lang.String |
getId()
Returns the primary key of this rule. |
ConstantParameter[] |
getInitParameters()
Returns the init parameters for this rule. |
java.lang.String |
getJavaRuleImplementorName()
Returns the full class name of the Java rule implementor of this rule. |
java.lang.String |
getOriginalRequirement()
Returns the initial business analyst requirement of this rule. |
int |
getPrecedence()
Returns the relative priority of this rule. |
IRule |
getRuleAtFiringLocation()
FOR IBM INTERNAL USE ONLY. |
IRuleCopy |
getRuleCopy()
Creates a copy of this rule and returns it. |
IRuleFolder |
getRuleFolder()
Returns the folder in which this rule is stored. |
java.lang.String |
getRuleName()
Returns the name of this rule. |
java.util.Date |
getStartDate()
Returns the date this rule comes into effect. |
java.lang.String |
getUserDefinedData()
Returns any user-defined data for this rule. |
boolean |
isClassifier()
Returns a value indicating if this rule is a classifier rule. |
boolean |
isReady()
Returns a value indicating whether this rule is ready for use. |
void |
move(IRuleFolder newRuleFolder)
Moves this rule to the given rule folder. |
void |
removeInitParameter(int index)
Removes the init parameter that is at the given index. |
void |
setBusinessIntent(java.lang.String newBusinessIntent)
Sets the business intent of this rule. |
void |
setClassification(java.lang.String newClassification)
Sets the classification of this rule. |
void |
setClassifier(boolean isClassifier)
Sets a value indicating if this rule is a classifier rule. |
void |
setDependentRules(java.lang.String[] newDependentRules)
Sets the names of the dependent rules of this rule. |
void |
setDescription(java.lang.String newDescription)
Sets the description of this rule. |
void |
setEndDate(java.util.Date newEndDate)
Sets the date when this rule expires. |
void |
setFiringLocation(int newFiringLocation)
Sets the firing location for this rule. |
void |
setFiringParameters(IParameter[] parameters)
Sets the firing parameters for this rule. |
void |
setInitParameters(ConstantParameter[] newInitParameters)
Sets the init parameters for this rule. |
void |
setJavaRuleImplementorName(java.lang.String newRuleImplementor)
Sets the full class name of the Java rule implementor of this rule. |
void |
setOriginalRequirement(java.lang.String newOriginalReq)
Sets the initial business analyst requirement of this rule. |
void |
setPrecedence(int newPrecedence)
Sets the relative priority of this rule. |
void |
setReady(boolean ready)
Sets a value indicating whether this rule is ready for use. |
void |
setRuleName(java.lang.String newRuleName)
Sets the name of this rule. |
void |
setStartDate(java.util.Date newStartDate)
Sets the date this rule comes into effect. |
void |
setUserDefinedData(java.lang.String newUserDefinedData)
Sets the user-defined data for this rule. |
java.lang.String |
toXML()
Returns the XML representation of this rule. |
Field Detail |
public static final int TYPE_REFERENCE
public static final int TYPE_COPY
updatePersistentRule
.public static final int FIRE_ANYWHERE
public static final int FIRE_LOCAL
public static final int FIRE_REMOTE
public static final int DATE_STATUS_IN_EFFECT
public static final int DATE_STATUS_PENDING
public static final int DATE_STATUS_EXPIRED
public static final int DATE_STATUS_NO_START_DATE
public static final int DATE_STATUS_INVALID
Method Detail |
public void addInitParameter(ConstantParameter initParameter) throws BusinessRuleBeansException, java.rmi.RemoteException
initParameter
- an init parameter to add to this rulepublic java.util.Vector checkRuleData() throws java.rmi.RemoteException
public IRule copy(int ruleReturnType) throws BusinessRuleBeansException, java.rmi.RemoteException
IRuleCopy
is returned. In this case,
the persistent rule is not created on the server until method
updatePersistentRule
is called on the
IRuleCopy
.
When returning a reference, the persistent rule is created on the server immediately.
ruleReturnType
- indicates whether to return a local copy (IRule.TYPE_COPY) or a reference (IRule.TYPE_REFERENCE)public void delete() throws BusinessRuleBeansException, java.rmi.RemoteException
updatePersistentRule
must be called before the
rule will be deleted from persistent storage.public java.lang.Object fire(TriggerPoint tp, java.lang.Object target, java.lang.Object[] firingParams) throws BusinessRuleBeansException, java.rmi.RemoteException
FiringStrategy
.tp
- the trigger point with which this rule is calledtarget
- the target object passed by the applicationfiringParams
- the parameters passed by the applicationBusinessRuleBeansException
- if a problem occurspublic java.lang.String getBusinessIntent() throws java.rmi.RemoteException
public java.lang.String getClassification() throws java.rmi.RemoteException
public int getDateStatus() throws java.rmi.RemoteException
java.rmi.RemoteException
- An error occurred processing the request.public java.lang.String[] getDependentRules() throws java.rmi.RemoteException
rule implementor
as the dependentRules
parameter on the init
method. Generally a rule implementor that handles dependent rules (for example
RuleAND
and
RuleIfThenElse
) will fire
each of the named rules.public java.lang.String getDescription() throws java.rmi.RemoteException
public java.util.Date getEndDate() throws java.rmi.RemoteException
public int getFiringLocation() throws java.rmi.RemoteException
public IParameter[] getFiringParameters() throws java.rmi.RemoteException
public java.lang.String getId() throws java.rmi.RemoteException
public ConstantParameter[] getInitParameters() throws java.rmi.RemoteException
public java.lang.String getJavaRuleImplementorName() throws java.rmi.RemoteException
public java.lang.String getOriginalRequirement() throws java.rmi.RemoteException
public int getPrecedence() throws java.rmi.RemoteException
public IRule getRuleAtFiringLocation() throws BusinessRuleBeansException, java.rmi.RemoteException
getFiringLocation()
public IRuleCopy getRuleCopy() throws BusinessRuleBeansException, java.rmi.RemoteException
BusinessRuleBeansException
- if an exception occurs creating the rulejava.rmi.RemoteException
- if a remote exception occurspublic IRuleFolder getRuleFolder() throws BusinessRuleBeansException, java.rmi.RemoteException
public java.lang.String getRuleName() throws java.rmi.RemoteException
public java.util.Date getStartDate() throws java.rmi.RemoteException
public java.lang.String getUserDefinedData() throws java.rmi.RemoteException
public boolean isClassifier() throws java.rmi.RemoteException
triggerClassifier
and the first phase of
triggerSituational
. Classifier rules are not found by
trigger
and the second phase of triggerSituational
.public boolean isReady() throws java.rmi.RemoteException
public void move(IRuleFolder newRuleFolder) throws BusinessRuleBeansException, java.rmi.RemoteException
newRuleFolder
- the new rule folder which will hold this rulepublic void removeInitParameter(int index) throws BusinessRuleBeansException, java.rmi.RemoteException
index
- the index of the init parameter to removeBRBeansIllegalArgumentException
- if given an illegal indexpublic void setBusinessIntent(java.lang.String newBusinessIntent) throws java.rmi.RemoteException
newBusinessIntent
- the new business intentpublic void setClassification(java.lang.String newClassification) throws BusinessRuleBeansException, java.rmi.RemoteException
newClassification
- the new classification of this rulepublic void setClassifier(boolean isClassifier) throws java.rmi.RemoteException
triggerClassifier
and the first phase of
triggerSituational
. Classifier rules are not found by
trigger
and the second phase of triggerSituational
.isClassifier
- true if this is a classifier rule, false otherwisepublic void setDependentRules(java.lang.String[] newDependentRules) throws BusinessRuleBeansException, java.rmi.RemoteException
rule implementor
as the dependentRules
parameter on the init
method. Generally a rule implementor that handles dependent rules (for example
RuleAND
and
RuleIfThenElse
) will fire
each of the named rules.newDependentRules
- an array of full rule names of the dependent rulespublic void setDescription(java.lang.String newDescription) throws java.rmi.RemoteException
newDescription
- the new descriptionpublic void setEndDate(java.util.Date newEndDate) throws java.rmi.RemoteException
newEndDate
- the new end date, or null if the rule should not expirepublic void setFiringLocation(int newFiringLocation) throws BusinessRuleBeansException, java.rmi.RemoteException
newFiringLocation
- the location at which this rule's implementor is firedpublic void setFiringParameters(IParameter[] parameters) throws BusinessRuleBeansException, java.rmi.RemoteException
parameters
- the firing parameters, or null if the firing parameters are passed directly
from the trigger point.public void setInitParameters(ConstantParameter[] newInitParameters) throws BusinessRuleBeansException, java.rmi.RemoteException
newInitParameters
- the new init parametersaddInitParameter(ConstantParameter)
public void setJavaRuleImplementorName(java.lang.String newRuleImplementor) throws BusinessRuleBeansException, java.rmi.RemoteException
newRuleImplementor
- the full class name of the Java rule implementor of this rulepublic void setOriginalRequirement(java.lang.String newOriginalReq) throws java.rmi.RemoteException
newOriginalReq
- the new original requirement of this rulepublic void setPrecedence(int newPrecedence) throws java.rmi.RemoteException
newPrecedence
- the relative priority of this rulepublic void setReady(boolean ready) throws java.rmi.RemoteException
ready
- boolean indicating whether this rule is ready for usepublic void setRuleName(java.lang.String newRuleName) throws BusinessRuleBeansException, java.rmi.RemoteException
newRuleName
- the name of this ruleBusinessRuleBeansException
- if the newRuleName
is invalid. A valid rule name cannot be null, cannot contain a '/' character, and cannot be
empty or all blanks.public void setStartDate(java.util.Date newStartDate) throws java.rmi.RemoteException
newStartDate
- the new start date of this rulepublic void setUserDefinedData(java.lang.String newUserDefinedData) throws java.rmi.RemoteException
newUserDefinedData
- the user-defined datapublic java.lang.String toXML() throws BusinessRuleBeansException, java.rmi.RemoteException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |