|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | 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 rule
BusinessRuleBeansException
java.rmi.RemoteException
public java.util.Vector checkRuleData() throws java.rmi.RemoteException
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)
BusinessRuleBeansException
java.rmi.RemoteException
public void delete() throws BusinessRuleBeansException, java.rmi.RemoteException
updatePersistentRule
must be called before the
rule will be deleted from persistent storage.
BusinessRuleBeansException
java.rmi.RemoteException
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 application
BusinessRuleBeansException
- if a problem occurs
java.rmi.RemoteException
public java.lang.String getBusinessIntent() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String getClassification() throws java.rmi.RemoteException
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.
java.rmi.RemoteException
public java.lang.String getDescription() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.util.Date getEndDate() throws java.rmi.RemoteException
java.rmi.RemoteException
public int getFiringLocation() throws java.rmi.RemoteException
java.rmi.RemoteException
public IParameter[] getFiringParameters() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String getId() throws java.rmi.RemoteException
java.rmi.RemoteException
public ConstantParameter[] getInitParameters() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String getJavaRuleImplementorName() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String getOriginalRequirement() throws java.rmi.RemoteException
java.rmi.RemoteException
public int getPrecedence() throws java.rmi.RemoteException
java.rmi.RemoteException
public IRule getRuleAtFiringLocation() throws BusinessRuleBeansException, java.rmi.RemoteException
BusinessRuleBeansException
java.rmi.RemoteException
getFiringLocation()
public IRuleCopy getRuleCopy() throws BusinessRuleBeansException, java.rmi.RemoteException
BusinessRuleBeansException
- if an exception occurs creating the rule
java.rmi.RemoteException
- if a remote exception occurspublic IRuleFolder getRuleFolder() throws BusinessRuleBeansException, java.rmi.RemoteException
BusinessRuleBeansException
java.rmi.RemoteException
public java.lang.String getRuleName() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.util.Date getStartDate() throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String getUserDefinedData() throws java.rmi.RemoteException
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
.
java.rmi.RemoteException
public boolean isReady() throws java.rmi.RemoteException
java.rmi.RemoteException
public void move(IRuleFolder newRuleFolder) throws BusinessRuleBeansException, java.rmi.RemoteException
newRuleFolder
- the new rule folder which will hold this rule
BusinessRuleBeansException
java.rmi.RemoteException
public void removeInitParameter(int index) throws BusinessRuleBeansException, java.rmi.RemoteException
index
- the index of the init parameter to remove
BRBeansIllegalArgumentException
- if given an illegal index
BusinessRuleBeansException
java.rmi.RemoteException
public void setBusinessIntent(java.lang.String newBusinessIntent) throws java.rmi.RemoteException
newBusinessIntent
- the new business intent
java.rmi.RemoteException
public void setClassification(java.lang.String newClassification) throws BusinessRuleBeansException, java.rmi.RemoteException
newClassification
- the new classification of this rule
BusinessRuleBeansException
java.rmi.RemoteException
public 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 otherwise
java.rmi.RemoteException
public 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 rules
BusinessRuleBeansException
java.rmi.RemoteException
public void setDescription(java.lang.String newDescription) throws java.rmi.RemoteException
newDescription
- the new description
java.rmi.RemoteException
public void setEndDate(java.util.Date newEndDate) throws java.rmi.RemoteException
newEndDate
- the new end date, or null if the rule should not expire
java.rmi.RemoteException
public void setFiringLocation(int newFiringLocation) throws BusinessRuleBeansException, java.rmi.RemoteException
newFiringLocation
- the location at which this rule's implementor is fired
BusinessRuleBeansException
java.rmi.RemoteException
public 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.
BusinessRuleBeansException
java.rmi.RemoteException
public void setInitParameters(ConstantParameter[] newInitParameters) throws BusinessRuleBeansException, java.rmi.RemoteException
newInitParameters
- the new init parameters
BusinessRuleBeansException
java.rmi.RemoteException
addInitParameter(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 rule
BusinessRuleBeansException
java.rmi.RemoteException
public void setOriginalRequirement(java.lang.String newOriginalReq) throws java.rmi.RemoteException
newOriginalReq
- the new original requirement of this rule
java.rmi.RemoteException
public void setPrecedence(int newPrecedence) throws java.rmi.RemoteException
newPrecedence
- the relative priority of this rule
java.rmi.RemoteException
public void setReady(boolean ready) throws java.rmi.RemoteException
ready
- boolean indicating whether this rule is ready for use
java.rmi.RemoteException
public void setRuleName(java.lang.String newRuleName) throws BusinessRuleBeansException, java.rmi.RemoteException
newRuleName
- the name of this rule
BusinessRuleBeansException
- if the newRuleName
is invalid. A valid rule name cannot be null, cannot contain a '/' character, and cannot be
empty or all blanks.
java.rmi.RemoteException
public void setStartDate(java.util.Date newStartDate) throws java.rmi.RemoteException
newStartDate
- the new start date of this rule
java.rmi.RemoteException
public void setUserDefinedData(java.lang.String newUserDefinedData) throws java.rmi.RemoteException
newUserDefinedData
- the user-defined data
java.rmi.RemoteException
public java.lang.String toXML() throws BusinessRuleBeansException, java.rmi.RemoteException
BusinessRuleBeansException
java.rmi.RemoteException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |