com.ibm.wbiserver.brules.mgmt
Interface BusinessRuleGroup
- public interface BusinessRuleGroup
- extends BusinessRuleValidateable, BusinessRuleChangeDetector, java.io.Serializable
A business rule group has a set of operations associated with it. These operations can
be retrieved using the
getOperations
method. The Operation
objects returned can be used to navigate to down to
the rulesets and decision tables that implement the operations.
A business rule group also has a set of properties associated with it. A property is a
name-value pair that is intended to give additional information about the business rule
group. There are two types of properties: user-defined and system-defined. User-defined
properties are completely defined and under the control of the user. They can be defined,
their values can be changed, and they can be removed. System-defined properties are defined
by the system and cannot be changed by the user. Properties can be used in queries to find
business rule groups whose properties match certain criteria. Refer to the classes in
the com.ibm.wbiserver.brules.mgmt.query
package for more information about
queries.
Methods are provided on the
BusinessRuleManager
class to
query for business rule groups based on the values assigned to the properties. Once you
have a business rule group you can get a list of its properties. This list includes both
system-defined and user-defined properties. System-defined properties are read-only. For
user-defined properties, you are also allowed to change the values of existing
properties, remove existing properties, and add new properties. No validation is performed
on the changes for user-defined properties since the properties and their values are
completely defined by the user.
Some data on the business rule group and its sub-objects is allowed to be changed. Many
changes are validated at the time the set method is called, however some changes cannot be
validated at that time. Therefore a validate
method is provided that can be
called to perform a complete validation after all changes are made. The validate
method will validate the object on which it is called and also all of its sub-objects.
Changes will also be validated at the time that they are published.
The user should use one of the methods on the
BusinessRuleManager
class to
get instances of the BusinessRuleGroup
interface. BusinessRuleManager
provides various method to either get all BusinessRuleGroup
objects accessible
to the server or to query on various properties of the business rule groups.
For situations where a business rule group or sub-objects are of a newer version than what
the runtime supports, a shell business rule group is instantiated. This situation occurs
when the runtime configuration involves multiple servers in a single cell where the servers
are of different runtime versions. Because a server can only support a certain amount of
features or level of the business rule language, those business rule groups or sub-objects
that use newer versions, will not be recognized by a management client and changes to these
artifacts may remove or corrupt the new items in the objects. The shell business rule group limits what
can be seen and changed in the newer business rule group version. The shell business rule group
will be limited to only the name and target namespace of the business rule group as well as two
properties, IBMSystemVersion and IBMSystemShell. The IBMSystemVersion property will list the
version of the model that was used to create the business rule group. If it is a sub-object
that is of a newer version, the version will be x.x.x signifing that it is a newer version that
can not be determined as only the business rule group has a version recorded with the model.
This property will not be part of the normal list of properties if the business rule group
is not a shell. The existance of the IBMSystemShell property indicates the business rule group
is a shel and not a regular business rule group.
The isShell
method can also be
used to check if the business rule group is a shell. A shell business rule group is limited in
function and basically read only. The getName
,
getTargetNameSpace
,
getProperties
,
getProperty
, and
getPropertyValue
methods are the only methods which are supported. All other get and set methods will result in
a UnsupportedOperationException
exception thrown.
Field Summary
Modifier and Type | Field and Description |
---|---|
|
COPYRIGHT
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
getDescription()
Get the description of the business rule group.
|
|
getDisplayName()
Get the display name for this business rule group.
|
|
getName()
Get the name of the business rule group.
|
getOperation(java.lang.String operationName)
Get the operation with the specified name from the list of operations for this
business rule group.
|
|
|
getOperations()
Get a list of all operations associated with this business rule group.
|
getPresentationTimezone()
Get the presentation time zone for the business rule group.
|
|
getProperties()
Get the list of properties associated with this business rule group.
|
|
getProperty(java.lang.String name)
Get the property on this business rule group that has the specified name.
|
|
|
getPropertyValue(java.lang.String name)
Get the value of the property on this business rule group that has the specified name.
|
|
getRuntimeID()
Returns a globally unique ID for the business rule group.
|
|
getSaveDate()
Get the date and time that the information in this copy of the business rule group
was saved to persistent storage.
|
|
getTargetNameSpace()
Get the target name space of the business rule group.
|
|
isDisplayNameSynchronizedToName()
Check to see if the display name is synchronized to the name for this business rule
group.
|
|
isGoverned()
Returns a boolean that indicates whether the business rule group is under
governance.
|
|
isShell()
Retrieve flag indicating if a business rule group is a shell which is an indication that
it is of a newer version than what is supported on the server on which it was retrieved.
|
refresh()
Retrieve this business rule group and its associated objects from persistent storage
again.
|
|
|
setDescription(java.lang.String newDescription)
Set the description associated with this business rule group.
|
|
setDisplayName(java.lang.String newDisplayName)
Set the display name for this business rule group.
|
|
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 group.
|
|
setGovernance(boolean governanceEnabled)
Set the governance value for the business rule group.
|
|
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
COPYRIGHT
- static final java.lang.String COPYRIGHT
Method Detail
getTargetNameSpace
- java.lang.String getTargetNameSpace( )
getName
- java.lang.String getName()
getDisplayName
- java.lang.String getDisplayName( )
isDisplayNameSynchronizedToName
and setDisplayName
for more
information.
java.lang.UnsupportedOperationException
- if the business rule group is a shell. setDisplayName
- void setDisplayName(java.lang.String newDisplayName)
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. The list of properties
for this business rule group will also be updated with the new display name value.
newDisplayName
- The new display name for this business rule group. May be null. DisplayNameNotChangeableException
- if the display name for this business rule
group is synchronized to the name. ChangesNotAllowedException
- if changes to this object are temporarily
disallowed while other changes are being published. java.lang.UnsupportedOperationException
- if the business rule group is a shell. isDisplayNameSynchronizedToName
- boolean isDisplayNameSynchronizedToName( )
true
if the display name is synchronized to the name for this
business rule group; otherwise false
. java.lang.UnsupportedOperationException
- if the business rule group is a shell. setDisplayNameIsSynchronizedToName
- void setDisplayNameIsSynchronizedToName( boolean newDisplayNameIsSynchronizedToName)
When this method is called with a value of true
, the display name is
automatically changed to have the same value as the name.
newDisplayNameIsSynchronizedToName
- The new value for the flag that determines
whether or not the display name is synchronized to the name for this business rule
group. ChangesNotAllowedException
- if changes to this object are temporarily
disallowed while other changes are being published. java.lang.UnsupportedOperationException
- if the business rule group is a shell. getDescription
- java.lang.String getDescription( )
java.lang.UnsupportedOperationException
- if the business rule group is a shell setDescription
- void setDescription(java.lang.String newDescription)
newDescription
- The new description to be associated with this business rule group.
May be null. ChangesNotAllowedException
- if changes to this object are temporarily
disallowed while other changes are being published. java.lang.UnsupportedOperationException
- if the business rule group is a shell. getPresentationTimezone
- PresentationTimezone getPresentationTimezone( )
java.lang.UnsupportedOperationException
- if the business rule group is a shell. getOperations
- java.util.List<Operation> getOperations( )
Operation
object returned represents one operation that can be invoked
on this business rule group component.
List
of Operation
objects. The returned
List
is unmodifiable. java.lang.UnsupportedOperationException
- if the business rule group is a shell. getOperation
- Operation getOperation(java.lang.String operationName)
operationName
- The name of the operation to return. Must not be null. Operation
object associated with this
BusinessRuleGroup
that has the specified name or null if there is no
such Operation
. java.lang.IllegalArgumentException
- if the specified name is null. java.lang.UnsupportedOperationException
- if the business rule group is a shell. getProperties
- PropertyList getProperties()
PropertyList
returned is empty.
For a shell business business rule group, the only two properties that will be returned are
PROPERTY_NAME__VERSION
and
PROPERTY_NAME__SHELL
.
getPropertyValue
- java.lang.String getPropertyValue( java.lang.String name)
PROPERTY_NAME__VERSION
and
PROPERTY_NAME__SHELL
.
name
- The name of the property whose value is to be returned. Must not be null. java.lang.IllegalArgumentException
- if the name parameter is null. getProperty
- Property getProperty(java.lang.String name)
PROPERTY_NAME__VERSION
and
PROPERTY_NAME__SHELL
.
name
- The name of the property to be retrieved. Must not be null. java.lang.IllegalArgumentException
- if the name parameter is null. setPropertyValue
- void setPropertyValue(java.lang.String name,
- java.lang.String value)
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 business rule group, then a
SystemPropertyNotChangeableException
will be thrown.
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. 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 group and it is system-defined. java.lang.UnsupportedOperationException
- if the business rule group is a shell. getSaveDate
- java.util.Date getSaveDate()
BusinessRuleGroup
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 BusinessRuleGroup
object. It is important to remember that
this is a copy of the save date at the point in time at which the
BusinessRuleGroup
was retrieved. If another user changes the business
rule group 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
BusinessRuleGroup
is retrieved, the save date in the new in-memory
copy will be different.
The save date of a business rule group 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 group in persistent storage. The in-memory copy of the
save date is updated when a publish is performed using that BusinessRuleGroup
object.
When a BusinessRuleGroup
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 group again and merge
the current changes into the new BusinessRuleGroup
.
java.lang.UnsupportedOperationException
- if the business rule group is a shell. refresh
- BusinessRuleGroup refresh()
- throws BusinessRuleManagementException
BusinessRuleGroup
object is returned containing the current
data from persistent storage. The BusinessRuleGroup
object on which this
method was called, as well as any of its sub-objects, should now be considered obsolete.
They contain old data.
it is possible that the business rule group has been deleted from persistent storage since it was originally retrieved. If this is the case, then this method will return null.
BusinessRuleGroup
object containing the current
data from persistent storage. May be null if the business rule group has been deleted
from persistent storage. java.lang.UnsupportedOperationException
- if the business rule group is a shell. isShell
- boolean isShell()
getRuntimeID
- java.lang.String getRuntimeID()
isGoverned
- boolean isGoverned()
setGovernance
- void setGovernance(boolean governanceEnabled)