IBM WebSphere Application ServerTM
Release 7

com.ibm.wbiserver.brules.mgmt
Interface Rule

All Superinterfaces:
BusinessRuleChangeDetector, BusinessRuleValidateable, java.io.Serializable
All Known Subinterfaces:
DecisionTableRule, DecisionTableTemplateInstanceRule, RuleSetRule, RuleSetTemplateInstanceRule, TemplateInstanceRule

public interface Rule
extends BusinessRuleValidateable, BusinessRuleChangeDetector, java.io.Serializable

This interface represents one rule within either a ruleset or a decision table. The rule may be a hard-coded rule or may be a rule instance created from a rule template. A hard-coded rule is represented by an instance of this interface; there is no sub-interface for a hard-coded rule. A rule that was created from a template is represented by an instance of TemplateInstanceRule.

A rule has a name and a user presentation string. The user presentation string specifies how the rule should be presented to the end user.


Field Summary
static java.lang.String COPYRIGHT
           
 
Method Summary
 java.lang.String getDescription()
          Get the description associated with this rule.
 java.lang.String getDisplayName()
          Get the display name for this rule.
 java.lang.String getExpandedUserPresentation()
          Get the user presentation for this rule with any placeholders for template parameters filled in with the actual value of the parameter.
 java.lang.String getName()
          Get the name of this rule.
 java.lang.String getUserPresentation()
          Get the user presentation for this rule.
 boolean isDisplayNameSynchronizedToName()
          Check to see if the display name is synchronized to the name for this rule.
 void setDescription(java.lang.String newDescription)
          Set the description associated with this rule.
 void setDisplayName(java.lang.String newDisplayName)
          Set the display name for this rule.
 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 rule.
 
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
See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Get the name of this rule.

Returns:
The name of this rule.

getDisplayName

java.lang.String getDisplayName()
Get the display name for this rule. The display name may have been specified during development of the rule to give a name that is more understandable to the business user. A flag can be set on the 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 rule. May be null.

setDisplayName

void setDisplayName(java.lang.String newDisplayName)
Set the display name for this rule. If the display name is synchronized to the name for this 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 rule. May be null.
Throws:
DisplayNameNotChangeableException - if the display name for this rule is synchronized to the name.
ChangesNotAllowedException - if changes to this object are temporarily disallowed while other changes are being published.

isDisplayNameSynchronizedToName

boolean isDisplayNameSynchronizedToName()
Check to see if the display name is synchronized to the name for this 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 rule; otherwise false.

setDisplayNameIsSynchronizedToName

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 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 rule.
Throws:
ChangesNotAllowedException - if changes to this object are temporarily disallowed while other changes are being published.

getDescription

java.lang.String getDescription()
Get the description associated with this rule.

Returns:
The description associated with this rule. May be null.

setDescription

void setDescription(java.lang.String newDescription)
Set the description associated with this rule.

Parameters:
newDescription - The new description to be associated with this rule. May be null.
Throws:
ChangesNotAllowedException - if changes to this object are temporarily disallowed while other changes are being published.

getUserPresentation

java.lang.String getUserPresentation()
Get the user presentation for this rule. If this rule is based on a template, then the returned presentation string makes use of a convention where template parameters are represented by the index of the parameter in the template's parameter list surrounded by curly braces ('{' and '}'). For example, consider the following user presentation string: "set output1 to {0} and output2 to {1}". "{0}" represents the first parameter in the template and "{1}" represents the second parameter in the template. If this rule is not based on a template, then there are no parameters to be shown in the string.

Returns:
The user presentation for this rule.

getExpandedUserPresentation

java.lang.String getExpandedUserPresentation()
Get the user presentation for this rule with any placeholders for template parameters filled in with the actual value of the parameter. If this rule is not based on a template, then this is the same as calling the getUserPresentation method. If this rule is based on a template, then all of the template parameter placeholders (denoted by curly braces, '{' and '}') will be filled in with the actual parameter values specified in this template instance.

Returns:
The user presentation for this rule with template parameter values filled in.

IBM WebSphere Application ServerTM
Release 7