com.ibm.wbiserver.brules.mgmt.dtable

Interface CaseEdge

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

  1. public interface CaseEdge
  2. extends BusinessRuleValidateable, BusinessRuleChangeDetector, java.io.Serializable
This interface represents a particular case (value) for a condition node. For example, consider a condition node that has a condition term of "mortgageValue". This condition node could have the following three case edges "<100000", ">= 100000 and <500000", and">= 500000", representing the cases where the mortgage value falls within the specified range. Each case edge must always be interpreted within the context of its containing condition node. A case edge can be thought of as the lines connecting a parent tree node to it children in the decision tree.

A CaseEdge itself cannot be changed. The value definition associated with the case edge may be changed if it is based on a template. Use the getValueDefinition method on this class to get the associated value definition. If the returned TreeConditionValueDefinition contains a template instance, then the template instance can be changed by changing the parameter values associated with it. The TreeConditionValueDefinition can also be changed to use a different template instance to define its value.


Field Summary

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

Method Summary

Modifier and Type Method and Description
  1. java.util.List<TreeConditionValueTemplate>
getAvailableValueTemplates()
Get the value templates available for use by this condition value.
  1. TreeNode
getChildNode()
Get the child node of this case edge.
  1. ConditionNode
getContainingConditionNode()
Get the condition node that contains this case edge.
  1. java.lang.String
getUserPresentation()
Get the user presentation string for this case edge.
  1. TreeConditionValueDefinition
getValueDefinition()
Get the value definition associated with this case edge.
  1. TemplateInstanceExpression
getValueTemplateInstance()
Get the template instance defining the value for this case edge.
  1. void
setValueTemplateInstance(TemplateInstanceExpression valueTemplateInstance)
Set the template instance defining the value for this case edge.
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

getChildNode

  1. TreeNode getChildNode()
Get the child node of this case edge. The child node is the next tree node that will be navigated to if the case represented by this case edge is true. It represents the next in a series of conditions or the final action that is to be taken.
Returns:
The child node of this case edge.

getContainingConditionNode

  1. ConditionNode getContainingConditionNode( )
Get the condition node that contains this case edge.
Returns:
The condition node that contains this case edge.

getValueDefinition

  1. TreeConditionValueDefinition getValueDefinition( )
Get the value definition associated with this case edge. This defines the particular case that is being checked for by this case edge.
Note that this method returns null in the case where a template is being used to define the value. In this case getValueTemplateInstance() will return a non-null value.
Returns:
The value definition associated with this case edge (or null if a template is being used).

getUserPresentation

  1. java.lang.String getUserPresentation( )
Get the user presentation string for this case edge. Each case edge will have either a template instance or a user presentation. It will not have both. If it has a template instance, then the user presentation can be obtained from the template associated with the template instance.

This is a convenenience method that is equivalent to performing the following sequence of method calls on this object: getValueDefinition().getUserPresentation().

Returns:
The user presentation string for this case edge. null if there is no user presentation.

getValueTemplateInstance

  1. TemplateInstanceExpression getValueTemplateInstance( )
Get the template instance defining the value for this case edge. This is a convenience method that is equivalent to making the following sequence of method calls on this object: getValueDefinition().getConditionValueTemplateInstance(). Of course, this will return null if a template is not being used for the value. In this case getValueDefinition() will return a non-null value.
Returns:
The template instance defining the value for this case edge. May be null if the value for this case edge is not defined by a template. If the value template instance is null, then the user presentation should be used.

setValueTemplateInstance

  1. void setValueTemplateInstance(TemplateInstanceExpression valueTemplateInstance)
  2. throws ValidationException
  3. java.lang.IllegalArgumentException
Set the template instance defining the value for this case edge. This method is intended to be used to change the template that is used to define the value for this case edge. 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 available to this case edge. The value templates for this case edge can be obtained using the getAvailableValueTemplates method on this object. 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 case edge to be changed from a hard-coded value to one defined by a template. If this is attempted, a ValidationException is thrown.

Note: the implementation of this method creates a new TreeConditionValueDefinition object containing the specified template instance. The new TreeConditionValueDefinition object becomes the new value definition for this case edge.

Parameters:
valueTemplateInstance - The new template instance defining the value for this case edge. The passed in TemplateInstanceExpression is checked to ensure that the template it is derived from is one of the templates available for this case edge, 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 case edge.
  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

  1. java.util.List<TreeConditionValueTemplate> getAvailableValueTemplates( )
Get the value templates available for use by this condition value. This is the set of templates that can be used to define TemplateInstanceExpressions for this condition value. This is a convenience method and is equivalent to performing the following sequence of method calls on this object: getContainingConditionNode().getTermDefinition().getConditionValueTemplates().
Returns:
The value templates available for use by this case edge. The returned List is unmodifiable.