Rule Execution Server API

ilog.rules.factory
Class IlrTaskSwitchNodeStatement

java.lang.Object
  extended by ilog.rules.factory.IlrBaseStatement
      extended by ilog.rules.factory.IlrFlowNodeStatement
          extended by ilog.rules.factory.IlrControlNodeStatement
              extended by ilog.rules.factory.IlrSplitNodeStatement
                  extended by ilog.rules.factory.IlrTaskSwitchNodeStatement
All Implemented Interfaces:
ilog.rules.factory.IlrSourceElement, IlrStatement, Serializable

public final class IlrTaskSwitchNodeStatement
extends IlrSplitNodeStatement

Represents the class of a switch node in a ruleflow.

Warning: Serialized objects of this class will not be compatible with future releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of IBM Decision Server.

See Also:
IlrTaskFactory, IlrSplitNodeStatement, IlrTaskJoinNodeStatement, IlrControlNodeStatement, IlrFlowNodeStatement, Serialized Form

Constructor Summary
IlrTaskSwitchNodeStatement(String name)
          Builds an switch node for a ruleflow.
IlrTaskSwitchNodeStatement(String name, IlrFlowNodeStatement previousNode)
          Builds a switch node for a rule flow and connects the created node to the passed node.
 
Method Summary
 IlrValue getValue()
          Returns the value that will be tested by the switch node.
 void setCaseNode(IlrConstantValue value, IlrFlowNodeStatement node)
          Sets the node that will be executed if the evaluation of the value linked to the switch matches the passed value.
 void setDefaultNode(IlrFlowNodeStatement node)
          Sets the node that will be executed if no case block matches the switch value.
 void setNextNode(IlrFlowNodeStatement node)
          This method should never be used; it throws an UnsupportedOperationException exception.
 void setValue(IlrValue value)
          Sets the value that will be tested by the switch node.
 
Methods inherited from class ilog.rules.factory.IlrSplitNodeStatement
close
 
Methods inherited from class ilog.rules.factory.IlrFlowNodeStatement
exploreStatement, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlrTaskSwitchNodeStatement

public IlrTaskSwitchNodeStatement(String name)
Builds an switch node for a ruleflow. It is useful to set a label if the node is the target of a goto statement.

Parameters:
name - The label used to target the node in a goto statement.

IlrTaskSwitchNodeStatement

public IlrTaskSwitchNodeStatement(String name,
                                  IlrFlowNodeStatement previousNode)
Builds a switch node for a rule flow and connects the created node to the passed node. This constructor should not be called to connect the new node to an IlrTaskIfNodeStatement nor to an IlrTaskSwitchNodeStatement. Instead, you should use IlrTaskIfNodeStatement.setTrueNode, IlrTaskIfNodeStatement.setFalseNode, IlrTaskSwitchNodeStatement.setCaseNode, IlrTaskSwitchNodeStatement.setDefaultNode. It is useful to set a label if the node is the target of a goto statement.

Parameters:
name - The label used to target the node in a goto statement.
previousNode - The node that is before the new node in the ruleflow. The two nodes are connected by calling the method IlrFlowNodeStatement.setNextNode.
Method Detail

setValue

public void setValue(IlrValue value)
Sets the value that will be tested by the switch node.

Parameters:
value - The value tested by the node.

getValue

public IlrValue getValue()
Returns the value that will be tested by the switch node.

Returns:
the value tested by the node.

setNextNode

public void setNextNode(IlrFlowNodeStatement node)
This method should never be used; it throws an UnsupportedOperationException exception. To link nodes to the if use setCaseNode or setDefaultNode instead.

See Also:
setCaseNode(ilog.rules.factory.IlrConstantValue, ilog.rules.factory.IlrFlowNodeStatement), setDefaultNode(ilog.rules.factory.IlrFlowNodeStatement)

setCaseNode

public void setCaseNode(IlrConstantValue value,
                        IlrFlowNodeStatement node)
Sets the node that will be executed if the evaluation of the value linked to the switch matches the passed value. Only one case block is executed.

Parameters:
value - The value for which the case block is said to match the switch value.
node - The node connected to the switch node that will be executed if this case is matched.
See Also:
setDefaultNode(ilog.rules.factory.IlrFlowNodeStatement)

setDefaultNode

public void setDefaultNode(IlrFlowNodeStatement node)
Sets the node that will be executed if no case block matches the switch value.

Parameters:
node - The node connected to the switch node that will be executed if no case is matched.
See Also:
setCaseNode(ilog.rules.factory.IlrConstantValue, ilog.rules.factory.IlrFlowNodeStatement)

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013