com.ibm.websphere.brb.mgmt
Interface IRuleCopy

All Superinterfaces:
IRule, java.io.Serializable

public interface IRuleCopy
extends IRule, java.io.Serializable

An IRuleCopy is a copy of a Rule that does not persist changes to the persistent Rule until the method updatePersistentRule is called. The IRuleCopy gives you local access to the data in the Rule. Not having to make remote method calls to access the data results in increased performance in many situations. Similarly, when updating a Rule, all changes can be forwarded to the remote Rule in one method call. Again, this is a performance consideration.

The method updatePersistentRule contains options for handling the case where the persistent Rule has changed between the time this copy was retrieved and the time that updatePersistentRule was called. See the constants RULE_CHANGED... in this class.


Field Summary
static int RULE_CHANGED_FORCE
          Rule change option - Force the changes in the copy to be saved.
static int RULE_CHANGED_RETURN_BOOLEAN
          Rule change option - Return true if the persistent Rule has not changed prior to updatePersistentRule being called and the update completed successfully.
static int RULE_CHANGED_THROW_EXCEPTION
          Rule change option - Throw a RuleChangedException if the persistent Rule has changed prior to the updatePersistentRule method being called.
 
Fields inherited from interface com.ibm.websphere.brb.mgmt.IRule
DATE_STATUS_EXPIRED, DATE_STATUS_IN_EFFECT, DATE_STATUS_INVALID, DATE_STATUS_NO_START_DATE, DATE_STATUS_PENDING, FIRE_ANYWHERE, FIRE_LOCAL, FIRE_REMOTE, TYPE_COPY, TYPE_REFERENCE
 
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.
 IRule getPersistentRule()
          Get a reference to the actual persistent 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 isMarkedForDeletion()
          Determine whether or not this rule is marked for deletion.
 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.
 void updatePersistentRule()
          Update the persistent Rule with the values in this copy.
 boolean updatePersistentRule(IRuleCopy originalRule, int changeOption)
          Update the persistent Rule with the values in this copy with options as to how to handle the case where changes have been made to the persistent Rule.

Parameter changeOption indicates how to handle the case where changes have been made to the persistent Rule.
 

Field Detail

RULE_CHANGED_FORCE

public static final int RULE_CHANGED_FORCE
Rule change option - Force the changes in the copy to be saved. Any changes made to the persistent Rule between the time this copy was received and the time this updatePersistentRule method was called are ignored. The new version is saved and any previous changes are lost.

RULE_CHANGED_THROW_EXCEPTION

public static final int RULE_CHANGED_THROW_EXCEPTION
Rule change option - Throw a RuleChangedException if the persistent Rule has changed prior to the updatePersistentRule method being called.

RULE_CHANGED_RETURN_BOOLEAN

public static final int RULE_CHANGED_RETURN_BOOLEAN
Rule change option - Return true if the persistent Rule has not changed prior to updatePersistentRule being called and the update completed successfully. Return false if the persistent Rule has changed. An exception could still be thrown if an error occured while attempting to update the persistent Rule.
Method Detail

addInitParameter

public void addInitParameter(ConstantParameter initParameter)
                      throws BusinessRuleBeansException
Description copied from interface: IRule
Adds the given init parameter to the end of the list of init parameters.
Specified by:
addInitParameter in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
initParameter - an init parameter to add to this rule

checkRuleData

public java.util.Vector checkRuleData()
Description copied from interface: IRule
Check for errors in the data for this rule. If any errors are found, return a Vector of ErrorMessage objects indicating what problems were found. The errors checked by this method will prevent the rule from working correctly. If the rule is not marked ready, any ErrorMessages returned will be marked as warnings since it may be valid to save the rule with errors. If the rule is marked ready, then these ErrorMessages will be marked as errors.

Specified by:
checkRuleData in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
Vector of ErrorMessages indicating what errors were found; null if no errors.

copy

public IRule copy(int ruleReturnType)
           throws BusinessRuleBeansException,
                  java.rmi.RemoteException
Description copied from interface: IRule
Creates a new rule initialized with the contents of this rule. The new rule will be the same as this rule, except that a new primary key is generated. The rule is created into the same folder as this rule. The rule can be created as a copy (IRule.TYPE_COPY) or as a reference to the persistent rule (IRule.TYPE_REFERENCE). When creating the rule as a local copy, an instance of class 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.

Specified by:
copy in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
ruleReturnType - indicates whether to return a local copy (IRule.TYPE_COPY) or a reference (IRule.TYPE_REFERENCE)
Returns:
the newly created rule

delete

public void delete()
            throws BusinessRuleBeansException
Description copied from interface: IRule
Deletes this rule. If this rule is an IRuleCopy, the method updatePersistentRule must be called before the rule will be deleted from persistent storage.
Specified by:
delete in interface IRule

fire

public java.lang.Object fire(TriggerPoint tp,
                             java.lang.Object target,
                             java.lang.Object[] firingParams)
                      throws BusinessRuleBeansException,
                             java.rmi.RemoteException
Description copied from interface: IRule
Fires this rule. If the rule implementor has not yet been instantiated, this method first instantiates it and initializes it with the values specified in this rule's initialization parameters. It then invokes the fire method on the rule implementor passing the values given to this method. Finally the result of firing the implementor is returned. This method should only be used in implementing a FiringStrategy.

Specified by:
fire in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
tp - the trigger point with which this rule is called
target - the target object passed by the application
firingParams - the parameters passed by the application
Returns:
the result of firing the rule implementor
Throws:
BusinessRuleBeansException - if a problem occurs

getBusinessIntent

public java.lang.String getBusinessIntent()
Description copied from interface: IRule
Returns the business intent of this rule. The business intent is the analyst-level description of this rule.

Specified by:
getBusinessIntent in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the business intent, or null if there is none

getClassification

public java.lang.String getClassification()
Description copied from interface: IRule
Returns the classification of this rule. The classification identifies a particular rule among a number of other rules with the same full rule name. Rules with a non-null classification are known as "classified" rules.

Specified by:
getClassification in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the classification, or null if it is unclassified

getDateStatus

public int getDateStatus()
Description copied from interface: IRule
Determine the rule's status. The status can be one of the following: See the description for each of these values above.

Specified by:
getDateStatus in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
The status of this rule.
Throws:
java.rmi.RemoteException - An error occurred processing the request.

getDependentRules

public java.lang.String[] getDependentRules()
Description copied from interface: IRule
Returns the names of the dependent rules of this rule. The dependent rules are a list of full rule names (both the folder and rule names) on which this rule depends. This value is passed to the 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.

Specified by:
getDependentRules in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
an array of full rule names of the dependent rules, or null if there are none

getDescription

public java.lang.String getDescription()
Description copied from interface: IRule
Returns the description of this rule. The description is a programmer-level description of the rule.

Specified by:
getDescription in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the description, or null if none exists

getEndDate

public java.util.Date getEndDate()
Description copied from interface: IRule
Returns the date when this rule expires. At this date and any date after it, this rule will not be "in effect". If the rule does not have an end date, null will be returned. A null end date means that the rule never expires.

Specified by:
getEndDate in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the end date, or null if no end date is specified

getFiringLocation

public int getFiringLocation()
Description copied from interface: IRule
Returns the firing location for this rule. The firing location indicates where the rule implementor should actually be fired. There are three options:
IRule.FIRE_LOCAL
Fires the rule implementor local to the trigger point. In some environments, in a servlet for example, this would actually be on the application server. The rule implementor class should exist on the same host as the trigger point.
IRule.FIRE_REMOTE
Fires the rule implementor remote from the trigger point. The rule implementor class should exist on the same host as the rule beans.
IRule.FIRE_ANYWHERE
First attempts to fire the rule implementor locally. If the rule implementor class cannot be found locally, it attempts to fire the rule implementor remotely.
Specified by:
getFiringLocation in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the location at which this rule's implementor is fired

getFiringParameters

public IParameter[] getFiringParameters()
Description copied from interface: IRule
Returns the firing parameters for this rule. If firing parameters are specified on the rule, these will override the firing parameters specified on the trigger point. Otherwise, the firing parameters are passed directly from the trigger point.

Specified by:
getFiringParameters in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the firing parameters, or null if the firing parameters are passed directly from the trigger point.

getId

public java.lang.String getId()
Description copied from interface: IRule
Returns the primary key of this rule.
Specified by:
getId in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the primary key of this rule

getInitParameters

public ConstantParameter[] getInitParameters()
Description copied from interface: IRule
Returns the init parameters for this rule. The init parameters are passed to the rule implementor's init method.

Specified by:
getInitParameters in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the init parameters, null if there are none

getJavaRuleImplementorName

public java.lang.String getJavaRuleImplementorName()
Description copied from interface: IRule
Returns the full class name of the Java rule implementor of this rule.

Specified by:
getJavaRuleImplementorName in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the full class name of the Java rule implementor of this rule

getOriginalRequirement

public java.lang.String getOriginalRequirement()
Description copied from interface: IRule
Returns the initial business analyst requirement of this rule. It can be used to keep track of why this rule was originally created, for example to help keep auditing records.

Specified by:
getOriginalRequirement in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the original requirement of this rule, or null if none is specified

getPersistentRule

public IRule getPersistentRule()
Get a reference to the actual persistent rule. Calling set methods on this reference will immediately change data in the persistent rule.
Returns:
The persistent rule.

getPrecedence

public int getPrecedence()
Description copied from interface: IRule
Returns the relative priority of this rule. The default finding strategy uses this value to order the rules, from the lowest numerical value to the highest.

Specified by:
getPrecedence in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the relative priority of this rule, which is zero by default

getRuleAtFiringLocation

public IRule getRuleAtFiringLocation()
                              throws BusinessRuleBeansException
Description copied from interface: IRule
FOR IBM INTERNAL USE ONLY. Returns the correct type of rule based on the firing location:
Specified by:
getRuleAtFiringLocation in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
a local copy or a reference to a rule on the server, depending on the firing location
See Also:
IRule.getFiringLocation()

getRuleCopy

public IRuleCopy getRuleCopy()
                      throws BusinessRuleBeansException
Description copied from interface: IRule
Creates a copy of this rule and returns it.
Specified by:
getRuleCopy in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
a new copy of this rule
Throws:
BusinessRuleBeansException - if an exception occurs creating the rule
java.rmi.RemoteException - if a remote exception occurs

getRuleFolder

public IRuleFolder getRuleFolder()
Description copied from interface: IRule
Returns the folder in which this rule is stored.
Specified by:
getRuleFolder in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the folder in which this rule is stored

getRuleName

public java.lang.String getRuleName()
Description copied from interface: IRule
Returns the name of this rule. The value returned does not contain information about the folder in which this rule is contained.
Specified by:
getRuleName in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the name of this rule

getStartDate

public java.util.Date getStartDate()
Description copied from interface: IRule
Returns the date this rule comes into effect. At any dates before this one, this rule will not be "in effect". If the start date is null, the rule is considered invalid.
Specified by:
getStartDate in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the start date

getUserDefinedData

public java.lang.String getUserDefinedData()
Description copied from interface: IRule
Returns any user-defined data for this rule. The user-defined data can contain any data desired by the rule user.
Specified by:
getUserDefinedData in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the user-defined data, or null if none is specified

isClassifier

public boolean isClassifier()
Description copied from interface: IRule
Returns a value indicating if this rule is a classifier rule. Only classifier rules are fired by triggerClassifier and the first phase of triggerSituational. Classifier rules are not found by trigger and the second phase of triggerSituational.
Specified by:
isClassifier in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
true if this is a classifier rule, false otherwise

isMarkedForDeletion

public boolean isMarkedForDeletion()
Determine whether or not this rule is marked for deletion. If the rule is marked for deletion, then the persistent rule will actually be deleted when updatePersistentRule() is called.
Returns:
true if this rule is marked for deletion; false otherwise.

isReady

public boolean isReady()
Description copied from interface: IRule
Returns a value indicating whether this rule is ready for use. Rules that are not ready are not found by BRBeans when firing rules.
Specified by:
isReady in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
true if this rule is ready for use, false otherwise

move

public void move(IRuleFolder newRuleFolder)
          throws BusinessRuleBeansException
Description copied from interface: IRule
Moves this rule to the given rule folder.
Specified by:
move in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newRuleFolder - the new rule folder which will hold this rule

removeInitParameter

public void removeInitParameter(int index)
                         throws BusinessRuleBeansException
Description copied from interface: IRule
Removes the init parameter that is at the given index.
Specified by:
removeInitParameter in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
index - the index of the init parameter to remove
Throws:
BRBeansIllegalArgumentException - if given an illegal index

setBusinessIntent

public void setBusinessIntent(java.lang.String newBusinessIntent)
Description copied from interface: IRule
Sets the business intent of this rule. The business intent is the analyst-level description of this rule.
Specified by:
setBusinessIntent in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newBusinessIntent - the new business intent

setClassification

public void setClassification(java.lang.String newClassification)
                       throws BusinessRuleBeansException
Description copied from interface: IRule
Sets the classification of this rule. The classification identifies a particular rule among a number of other rules with the same full rule name. Rules with a non-null classification are known as "classified" rules.
Specified by:
setClassification in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newClassification - the new classification of this rule

setClassifier

public void setClassifier(boolean isClassifier)
Description copied from interface: IRule
Sets a value indicating if this rule is a classifier rule. Only classifier rules are fired by triggerClassifier and the first phase of triggerSituational. Classifier rules are not found by trigger and the second phase of triggerSituational.
Specified by:
setClassifier in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
isClassifier - true if this is a classifier rule, false otherwise

setDependentRules

public void setDependentRules(java.lang.String[] newDependentRules)
                       throws BusinessRuleBeansException
Description copied from interface: IRule
Sets the names of the dependent rules of this rule. The dependent rules are a list of full rule names (both the folder and rule names) on which this rule depends. This value is passed to the 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.
Specified by:
setDependentRules in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newDependentRules - an array of full rule names of the dependent rules

setDescription

public void setDescription(java.lang.String newDescription)
Description copied from interface: IRule
Sets the description of this rule. The description is a programmer-level description of the rule.
Specified by:
setDescription in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newDescription - the new description

setEndDate

public void setEndDate(java.util.Date newEndDate)
Description copied from interface: IRule
Sets the date when this rule expires. At this date and any date after it, this rule will not be "in effect". Null should be passed if the rule is to have no expiration date.
Specified by:
setEndDate in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newEndDate - the new end date, or null if the rule should not expire

setFiringLocation

public void setFiringLocation(int newFiringLocation)
                       throws BusinessRuleBeansException
Description copied from interface: IRule
Sets the firing location for this rule. The firing location indicates where the rule implementor should actually be fired. There are three options:
Rule.FIRE_LOCAL
Fires the rule implementor local to the trigger point. In some environments, in a servlet for example, this would actually be on the application server. The rule implementor class should exist on the same host as the trigger point.
Rule.FIRE_REMOTE
Fires the rule implementor remote from the trigger point. The rule implementor class should exist on the same host as the rule beans.
Rule.FIRE_ANYWHERE
First attempts to fire the rule implementor local to the trigger point. If the rule implementor is not found locally, an attempt will then be made to fire the rule remotely.
Specified by:
setFiringLocation in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newFiringLocation - the location at which this rule's implementor is fired

setFiringParameters

public void setFiringParameters(IParameter[] parameters)
                         throws BusinessRuleBeansException
Description copied from interface: IRule
Sets the firing parameters for this rule. If firing parameters are specified on the rule, these will override the firing parameters specified on the trigger point. Otherwise, the firing parameters are passed directly from the trigger point.
Specified by:
setFiringParameters in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
parameters - the firing parameters, or null if the firing parameters are passed directly from the trigger point.

setInitParameters

public void setInitParameters(ConstantParameter[] newInitParameters)
                       throws BusinessRuleBeansException
Description copied from interface: IRule
Sets the init parameters for this rule. The init parameters are passed to the rule implementor's init method.
Specified by:
setInitParameters in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newInitParameters - the new init parameters
See Also:
IRule.addInitParameter(ConstantParameter)

setJavaRuleImplementorName

public void setJavaRuleImplementorName(java.lang.String newRuleImplementor)
                                throws BusinessRuleBeansException
Description copied from interface: IRule
Sets the full class name of the Java rule implementor of this rule.
Specified by:
setJavaRuleImplementorName in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newRuleImplementor - the full class name of the Java rule implementor of this rule

setOriginalRequirement

public void setOriginalRequirement(java.lang.String newOriginalReq)
Description copied from interface: IRule
Sets the initial business analyst requirement of this rule. It can be used to keep track of why this rule was originally created, for example to help keep auditing records.
Specified by:
setOriginalRequirement in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newOriginalReq - the new original requirement of this rule

setPrecedence

public void setPrecedence(int newPrecedence)
Description copied from interface: IRule
Sets the relative priority of this rule. The default finding strategy uses this value to order the rules discovered in the database, from lowest to highest.
Specified by:
setPrecedence in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newPrecedence - the relative priority of this rule

setReady

public void setReady(boolean ready)
Description copied from interface: IRule
Sets a value indicating whether this rule is ready for use. Rules that are not ready are not found by BRBeans when triggering (firing) rules.
Specified by:
setReady in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
ready - boolean indicating whether this rule is ready for use

setRuleName

public void setRuleName(java.lang.String newRuleName)
                 throws BusinessRuleBeansException
Description copied from interface: IRule
Sets the name of this rule.
Specified by:
setRuleName in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newRuleName - the name of this rule
Throws:
BusinessRuleBeansException - if the newRuleName is invalid. A valid rule name cannot be null, cannot contain a '/' character, and cannot be empty or all blanks.

setStartDate

public void setStartDate(java.util.Date newStartDate)
Description copied from interface: IRule
Sets the date this rule comes into effect. At any dates before this one, this rule will not be "in effect". A null value will make the rule invalid.
Specified by:
setStartDate in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newStartDate - the new start date of this rule

setUserDefinedData

public void setUserDefinedData(java.lang.String newUserDefinedData)
Description copied from interface: IRule
Sets the user-defined data for this rule. The user-defined data can contain any data desired by the rule user.
Specified by:
setUserDefinedData in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Parameters:
newUserDefinedData - the user-defined data

toXML

public java.lang.String toXML()
                       throws BusinessRuleBeansException,
                              java.rmi.RemoteException
Description copied from interface: IRule
Returns the XML representation of this rule.
Specified by:
toXML in interface IRule
Following copied from interface: com.ibm.websphere.brb.mgmt.IRule
Returns:
the XML representation of this rule

updatePersistentRule

public void updatePersistentRule()
                          throws BusinessRuleBeansException,
                                 java.rmi.RemoteException
Update the persistent Rule with the values in this copy. Any changes made to the persistent rule separate from this copy will be lost.
Throws:
BusinessRuleBeansException - If the Rule could not be updated.

updatePersistentRule

public boolean updatePersistentRule(IRuleCopy originalRule,
                                    int changeOption)
                             throws BusinessRuleBeansException,
                                    java.rmi.RemoteException
Update the persistent Rule with the values in this copy with options as to how to handle the case where changes have been made to the persistent Rule.

Parameter changeOption indicates how to handle the case where changes have been made to the persistent Rule. The three choices are: See the description for each of these values above. The following example updates a local copy of a rule and checks for changes having been made to the original persistent Rule.
   IRuleFolder lifeFolder = root.getRuleFolder("com/acme/insurance/life");
   IRuleCopy originalRuleCopy = (IRuleCopy) lifeFolder.findRulesByName("isSeniorCitizen", 
                                                                       true,
                                                                       IRule.TYPE_COPY);
   IRuleCopy changedRule = originalRuleCopy.getRuleCopy();

   // Change senior citizen status from 62 to 65
   ConstantParameter[] initParms = { new ConstantParameter(Integer(65)) };
   changedRule.setInitParameters(initParms);

   // Tell the local copy of the rule to update itself, expect to get back an
   // exception if the rule has changed.
   try {
      changedRule.updatePersistentRule(originalRuleCopy, IRuleCopy.RULE_CHANGED_THROW_EXCEPTION);
   } catch (RuleChangedException) {
      throw new RuntimeException("Could not update the SeniorCitizen Rule");
   }
 
Parameters:
originalRule - A copy of the original rule data before changes were made. The method compares the persistent rule against this copy to determine if any changes have been made since the rule was originally retrieved. This parameter is ignored if RULE_CHANGED_FORCE is specified for the change option.
changeOption - indicates how to handle the case where changes have been made to the persistent Rule
Returns:
If the changeOption is IRuleCopy.RULE_CHANGED_RETURN_BOOLEAN, then false is returned in the case where the persistent rule has changed. Otherwise true is returned.
Throws:
com.ibm.websphere.brb.RuleChangedException - If the Rule has changed and the option RULE_CHANGED_THROW_EXCEPTION was specified
BusinessRuleBeansException - If the Rule could not be updated.