com.ibm.wbiserver.brules.mgmt

Interface BusinessRule

All Superinterfaces:
BusinessRuleChangeDetector, BusinessRuleValidateable, java.io.Serializable
All known subinterfaces:
DecisionTable, RuleSet

  1. public interface BusinessRule
  2. extends BusinessRuleValidateable, BusinessRuleChangeDetector, java.io.Serializable
This interface represents a business rule, which can be either a ruleset or a decision table. New business rules can be created by creating a copy of an existing business rule using the createCopy method. This is the only way to create a new business rule using the API.

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
COPYRIGHT

Method Summary

Modifier and Type Method and Description
  1. BusinessRule
createCopy(java.lang.String newTargetNameSpace,java.lang.String newName)
Create a copy of this BusinessRule with a new name.
  1. Operation
getAssociatedOperation()
Get the Operation for which this business rule is defined.
  1. java.lang.String
getDescription()
Get the description associated with this business rule.
  1. java.lang.String
getDisplayName()
Get the display name for this business rule.
  1. java.lang.String
getName()
Get the name of the business rule.
  1. PropertyList
getProperties()
Get the list of properties associated with this business rule.
  1. Property
getProperty(java.lang.String name)
Get the property on this business rule that has the specified name.
  1. java.lang.String
getPropertyValue(java.lang.String name)
Get the value of the property on this business rule that has the specified name.
  1. java.lang.String
getRuntimeID()
Returns a globally unique ID for the business rule.
  1. java.util.Date
getSaveDate()
Get the date and time that the information in this copy of the business rule was saved to persistent storage.
  1. java.lang.String
getTargetNameSpace()
Get the target name space of the business rule.
  1. BusinessRuleType
getType()
Get the type of this business rule.
  1. boolean
isDisplayNameSynchronizedToName()
Check to see if the display name is synchronized to the name for this business rule.
  1. void
setDescription(java.lang.String newDescription)
Set the description associated with this business rule.
  1. void
setDisplayName(java.lang.String newDisplayName)
Set the display name for this business rule.
  1. void
setDisplayNameIsSynchronizedToName(boolean newDisplayNameIsSynchronizedToName)
Change the value of the flag that determines whether or not the display name is synchronized to the name for this business rule.
  1. void
setPropertyValue(java.lang.String name,java.lang.String value)
Set the value of the property with the specified name to the specified value.
Methods inherited from interface com.ibm.wbiserver.brules.mgmt.BusinessRuleValidateable
validate
Methods inherited from interface com.ibm.wbiserver.brules.mgmt.BusinessRuleChangeDetector
hasChanges

Field Detail

  1. static final java.lang.String COPYRIGHT
See Also:

Method Detail

getTargetNameSpace

  1. java.lang.String getTargetNameSpace( )
Get the target name space of the business rule.
Returns:
The target name space of the business rule.

getName

  1. java.lang.String getName()
Get the name of the business rule.
Returns:
The name of the business rule.

getDisplayName

  1. java.lang.String getDisplayName( )
Get the display name for this business rule. The display name may have been specified during development of the business rule to give a name that is more understandable to the business user. A flag can be set on the business rule to ensure that the display name value is always synchronized to the name value. If this flag is turned on, then the display name cannot be changed. See isDisplayNameSynchronizedToName and setDisplayName for more information.
Returns:
the display name of this business rule. May be null.

setDisplayName

  1. void setDisplayName(java.lang.String newDisplayName)
Set the display name for this business rule. If the display name is synchronized to the name for this business rule (see isDisplayNameSynchronizedToName), then changes to the display name are not allowed. This is because the name field takes precedence over the display name and the name field cannot be changed. In this case a DisplayNameNotChangeableException is thrown.
Parameters:
newDisplayName - The new display name for this business rule. May be null.
Throws:
DisplayNameNotChangeableException - if the display name for this business rule is synchronized to the name.
ChangesNotAllowedException - if changes to this object are temporarily disallowed while other changes are being published.

isDisplayNameSynchronizedToName

  1. boolean isDisplayNameSynchronizedToName( )
Check to see if the display name is synchronized to the name for this business rule. Synchronizing the display name to the name means that the display name value will always be the same as the name value. One consequence of this is that since the name is not changeable, when the two are synchronized you are not allowed to change the display name either. If the display name is not synchronized to the name, then the display name can be changed.
Returns:
true if the display name is synchronized to the name for this business rule; otherwise false.

setDisplayNameIsSynchronizedToName

  1. void setDisplayNameIsSynchronizedToName( boolean newDisplayNameIsSynchronizedToName)
Change the value of the flag that determines whether or not the display name is synchronized to the name for this business rule. Synchronizing the display name to the name means that the display name value will always be the same as the name value. One consequence of this is that since the name is not changeable, when the two are synchronized you are not allowed to change the display name either. If the display name is not synchronized to the name, then the display name can be changed.

When this method is called with a value of true, the display name is automatically changed to have the same value as the name.

Parameters:
newDisplayNameIsSynchronizedToName - The new value for the flag that determines whether or not the display name is synchronized to the name for this business rule.
Throws:
ChangesNotAllowedException - if changes to this object are temporarily disallowed while other changes are being published.

getType

  1. BusinessRuleType getType()
Get the type of this business rule.
Returns:
The type of this business rule.

getDescription

  1. java.lang.String getDescription( )
Get the description associated with this business rule.
Returns:
The description associated with this business rule. May be null.

setDescription

  1. void setDescription(java.lang.String newDescription)
Set the description associated with this business rule.
Parameters:
newDescription - The new description to be associated with this business rule. May be null.
Throws:
ChangesNotAllowedException - if changes to this object are temporarily disallowed while other changes are being published.

getAssociatedOperation

  1. Operation getAssociatedOperation( )
Get the Operation for which this business rule is defined.
Returns:
The Operation for which this business rule is defined.

getSaveDate

  1. java.util.Date getSaveDate()
Get the date and time that the information in this copy of the business rule was saved to persistent storage. This date and time is stored in persistent storage along with the business rule. When a BusinessRule is retrieved using one of the methods on the BusinessRuleManager class, its save date is retrieved from persistent storage as well and is stored in the in-memory BusinessRule object. It is important to remember that this is a copy of the save date at the point in time at which the BusinessRule was retrieved. If another user changes the business rule in persistent storage, the save date in persistent storage will now be different than the date in your in-memory copy. The next time the BusinessRule is retrieved, the save date in the new in-memory copy will be different.

The save date of a business rule in persistent storage is only changed when a change is published using the BusinessRuleManager publish method or when some other operation (such as installing a new version of the application) updates the business rule in persistent storage. The in-memory copy of the save date is updated when a publish is performed that updates that BusinessRule object.

When a BusinessRule is published, if the save date in persistent storage is different from the save date in the in-memory object that is being published, then the publish will fail with a ChangeConflictException. This is because publishing the current changes would overwrite changes that were made by some other user. When you get a ChangeConflictException, if you still want to publish the current changes, you must retrieve the business rule again and merge the current changes into the new BusinessRule object.

Returns:
the date and time that the information in this copy of the business rule was saved to persistent storage.

createCopy

  1. BusinessRule createCopy(java.lang.String newTargetNameSpace,
  2. java.lang.String newName)
  3. throws ValidationException
  4. BusinessRuleManagementException
Create a copy of this BusinessRule with a new name. The new BusinessRule is added to the available targets list of the operation associated with the original BusinessRule. The target name space and name specified must be unique across all rulesets and decision tables available to this server. If it is not, a ValidationException is thrown. The BusinessRule on which this method is being called must also be valid. If not, a ValidationException is thrown.
Parameters:
newTargetNameSpace - The target name space for the new BusinessRule. Must not be null or the zero-length string.
newName - The name for the new BusinessRule. Must not be null or the zero-length string.
Returns:
A new BusinessRule object that is a copy of this BusinessRule but with a different name.
Throws:
ValidationException - if the specified target name space and name is already in use for another business rule available to this server or if the BusinessRule on which this method is called is not valid, in other words if it would produce validation errors if the validate method was called on it.
java.lang.IllegalArgumentException - if any required parameters are not specified or if they are the zero-length string.
BusinessRuleManagementException - if an unexpected error is detected.

getRuntimeID

  1. java.lang.String getRuntimeID()
Returns a globally unique ID for the business rule. The ID value is set on installation. The ID remains the same between retrievals and publishes. If an artifact was installed in a previous application version, it will be updated and a new ID value will be created.
Returns:
a globally unique ID

getProperties

  1. PropertyList getProperties()
Get the list of properties associated with this business rule. This list includes both system-defined and user-defined properties. If this business rule has no properties, then the PropertyList returned is empty.
Returns:
The list of properties associated with this rule.

getPropertyValue

  1. java.lang.String getPropertyValue( java.lang.String name)
Get the value of the property on this business rule that has the specified name. Returns null if there is no property with that name.
Parameters:
name - The name of the property whose value is to be returned. Must not be null.
Returns:
The value of the property on this business rule that has the specified name. Returns null if there is no property with that name.
Throws:
java.lang.IllegalArgumentException - if the name parameter is null.

getProperty

  1. Property getProperty(java.lang.String name)
Get the property on this business rule that has the specified name. Returns null if there is no property with that name.
Parameters:
name - The name of the property to be retrieved. Must not be null.
Returns:
The property on this business rule that has the specified name. Returns null if there is no property with that name.
Throws:
java.lang.IllegalArgumentException - if the name parameter is null.

setPropertyValue

  1. void setPropertyValue(java.lang.String name,
  2. java.lang.String value)
Set the value of the property with the specified name to the specified value. If a property with the specified name already exists, then its value is changed to the specified value. If no property exists with the specified name, then a new property is defined with the specified name and value. If the specified value is null and the property is currently defined, then the property will be removed from this business rule. If the specified value is null and the property is not currently defined, then no action is taken.

Only user-defined properties are changeable. If a property with the specified name does not already exist, the new property created will be user-defined. If a system-defined property with the specified name already exists for this rule, then a SystemPropertyNotChangeableException will be thrown.

Parameters:
name - The name of the property whose value is to be set. Must not be null or the zero-length string.
value - The value that the property should be set to. May be null.
Throws:
java.lang.IllegalArgumentException - if the name parameter is null or is the zero-length string.
SystemPropertyNotChangeableException - if a property with the specified name already exists for this business rule and it is system-defined.