IBM WebSphere Application ServerTM
Release 7

com.ibm.wbiserver.brules.mgmt.dtable
Interface TreeAction

All Superinterfaces:
BusinessRuleChangeDetector, BusinessRuleValidateable, java.io.Serializable

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

This interface represents one action within a decision tree action node. Each of these actions assigns a value to a variable (referred to as the "term"). Each TreeAction contains the following:

  1. The definition of the term for this action. This defines the variable that a value will be assigned to by this action.
  2. The user presentation string for the value for this action. This defines how the value should be presented to the end user. This may be null if there is no user presentation or if the value is defined by a template, i.e. there is a value template instance. In this case the user presentation is defined by the template used to define the value.
  3. A template instance that defines the value for this action. This may be null if the value is not defined by a template.
  4. An indication of whether or not the value is "not applicable". A "not applicable" value means that the action is an invocation of another SCA component.

The value for each tree action is either a hard-coded expression or is defined by a template instance. The hard-coded expression cannot be obtained using the API. If the value is a hard-coded expression, then the value user presentation string should be used to determine how to present the value to the user. If the value is defined by a template instance, then the associated template, along with the parameter values from the template instance, should be used to determine how to present the value to the user.


Field Summary
static java.lang.String COPYRIGHT
           
 
Method Summary
 java.util.List<TreeActionValueTemplate> getAvailableValueTemplates()
          Get the value templates available for use by this action.
 TreeActionTermDefinition getTermDefinition()
          Get the definition of the term of this tree action.
 TemplateInstanceExpression getValueTemplateInstance()
          Get the template instance defining the value for this action.
 java.lang.String getValueUserPresentation()
          Get the user presentation string for the value for this tree action.
 boolean isValueNotApplicable()
          Determine whether or not the value is "not applicable".
 void setValueTemplateInstance(TemplateInstanceExpression valueTemplateInstance)
          Set the template instance defining the value for this action.
 
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

getTermDefinition

TreeActionTermDefinition getTermDefinition()
Get the definition of the term of this tree action. The term is the "left-hand side" of the action and defines the variable to which a value will be assigned by this action.

Returns:
The definition of the term of this tree action.

isValueNotApplicable

boolean isValueNotApplicable()
Determine whether or not the value is "not applicable". A "not applicable" value means that the action is an invocation of another SCA component.

Returns:
true if the value is "not applicable; otherwise false.

getValueTemplateInstance

TemplateInstanceExpression getValueTemplateInstance()
Get the template instance defining the value for this action.

Returns:
The template instance defining the value for this action. May be null if the value for this action is not defined by a template. If the value template instance is null, then the value user presentation should be used.

setValueTemplateInstance

void setValueTemplateInstance(TemplateInstanceExpression valueTemplateInstance)
                              throws ValidationException,
                                     java.lang.IllegalArgumentException
Set the template instance defining the value for this action. This method is intended to be used to change the template that is used to define the value for this action. If you simply want to change the value of a parameter in the template instance and not change the template being used, then you can use the getValueTemplateInstance method to get the current template instance, get the ParameterValue objects from the returned TemplateInstanceExpression and change the value for the desired parameters.

A new TemplateInstanceExpression can be created by from one of the value templates defined for this action. The value templates for this action can be obtained using the getAvailableValueTemplates method on this object. They can also be obtained by using the getTermDefinition method on this object to get the TreeActionTermDefinition for this action and then using the getValueTemplates to get the value templates. These two methods are equivalent.

If the value template instance for this object is currently null, then it is not allowed to set the value template instance to a non-null value. In other words, the API does not allow the action to be changed from a hard-coded action to one defined by a template. If this is attempted, a ValidationException is thrown.

Parameters:
valueTemplateInstance - The new template instance defining the value for this action. The passed in TemplateInstanceExpression is checked to ensure that the template it is derived from is one of the templates available for this action, i.e. that it is one of the templates returned by the getAvailableValueTemplates on this object. If it is not, then a ValidationException is thrown. If the current value of the value template instance field is not null, then this parameter must be non-null. Otherwise an IllegalArgumentException is thrown.
Throws:
ValidationException - if either of the following is true:
    The template instance is not derived from a template that is available to this action.
  1. The current value template instance is null and the passed in TemplateInstanceExpression is not null.
java.lang.IllegalArgumentException - if the current value of the value template instance field is not null and the passed in value is null.
ChangesNotAllowedException - if changes to this object are temporarily disallowed while other changes are being published.

getAvailableValueTemplates

java.util.List<TreeActionValueTemplate> getAvailableValueTemplates()
Get the value templates available for use by this action. This is the set of templates that can be used to define TemplateInstanceExpressions for this action. This is a convenience method and is equivalent to performing the following sequence of method calls on this object: getTermDefinition().getValueTemplates().

Returns:
The value templates available for use by this action. The returned List is unmodifiable.

getValueUserPresentation

java.lang.String getValueUserPresentation()
Get the user presentation string for the value for this tree action. This string defines how the value should be presented to the end user.

Returns:
The user presentation string for the value for this tree action. May be null if there is no user presentation string for the value. If the value user presentation is null, then the value template instance should be used.

IBM WebSphere Application ServerTM
Release 7