Rule Execution Server API

ilog.rules.factory
Class IlrRuleFactory

java.lang.Object
  extended by ilog.rules.factory.IlrRuleFactory
All Implemented Interfaces:
ilog.rules.factory.IlrRuleElement, ilog.rules.factory.IlrRulesetElement, Serializable

public class IlrRuleFactory
extends Object
implements Serializable, ilog.rules.factory.IlrRuleElement

A rule definition of the rule language.

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:
Serialized Form

Field Summary
 String formalComment
          The formal comment of the rule.
 String name
          The fully qualified name of the rule.
 String packetName
          Deprecated.  
 IlrValue priority
          The priority value of the rule.
 
Constructor Summary
IlrRuleFactory(IlrReflect reflect, IlrPackageFactory pkg, String name)
          Constructs a rule factory using a reflect and a rule name.
IlrRuleFactory(IlrReflect reflect, String definitionName)
          Deprecated. Use instead IlrRuleFactory(IlrReflect reflect, IlrPackageFactory pkg, String definitionName)
 
Method Summary
 void addCondition(IlrCondition cond)
          Adds a condition to the rule.
 void addElseStatement(IlrStatement statement)
          Appends an action to the rule's else part.
 void addStatement(IlrStatement statement)
          Adds an action to the rule.
 Enumeration enumerateConditions()
          Gets an enumeration to visit all the conditions of the rule.
 Enumeration enumerateElseStatements()
          Gets an enumeration to visit all the actions of the rule's else part.
 Enumeration enumerateStatements()
          Gets an enumeration to visit all the actions of the rule.
 int getConditionCount()
          Gets the number of conditions in the rule.
 IlrCondition[] getConditions()
          Gets the conditions of the rule.
 int getElseStatementCount()
          Gets the number of actions in the else part.
 IlrStatement[] getElseStatements()
          Gets the actions of the rule's else part.
 IlrPackageFactory getPackage()
          Returns the package in which the rule is defined.
 IlrPropertyList getProperties()
          Gets the property list of this rule factory.
 String getShortName()
          Gets the short name of the rule.
 int getStatementCount()
          Gets the number of actions.
 IlrStatement[] getStatements()
          Gets the actions of the rule.
 void removeCondition(IlrCondition cond)
          Removes a condition from the rule.
 void removeElseStatement(IlrStatement statement)
          Removes an action from the rule's else part.
 void removeStatement(IlrStatement statement)
          Removes an action from the rule.
 void setConditions(IlrCondition[] conditions)
          Sets the conditions of the rule.
 void setElseStatements(IlrStatement[] statements)
          Sets the actions of the rule's else part.
 void setStatements(IlrStatement[] statements)
          Set the actions of the rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public String name
The fully qualified name of the rule.


packetName

public String packetName
Deprecated. 
The packet name of the rule.


formalComment

public String formalComment
The formal comment of the rule.


priority

public IlrValue priority
The priority value of the rule.

Constructor Detail

IlrRuleFactory

public IlrRuleFactory(IlrReflect reflect,
                      String definitionName)
Deprecated. Use instead IlrRuleFactory(IlrReflect reflect, IlrPackageFactory pkg, String definitionName)

Constructs a rule factory using a reflect and a rule name. The constructed rule factory has neither packet name nor formal comment. The rule is considered to belong to the default package. It is attached to the reflect object passed as an argument. The priority is set to have the default priority value. Both the condition and the action parts are empty.

Parameters:
reflect - The reflect object of this rule factory.
definitionName - The name of the rule.

IlrRuleFactory

public IlrRuleFactory(IlrReflect reflect,
                      IlrPackageFactory pkg,
                      String name)
Constructs a rule factory using a reflect and a rule name. The constructed rule factory has neither packet name nor formal comment. The rule belongs to the specified package. In case the package is null, the rule is considered to belong to the default package. It is attached to the reflect object passed as an argument. The priority is set to have the default priority value. Both the condition and the action parts are empty.

Parameters:
reflect - The reflect object of this rule factory.
pkg - The package to which the rule belongs.
name - The name of the rule.
Method Detail

getProperties

public final IlrPropertyList getProperties()
Gets the property list of this rule factory.

Returns:
A property list.

addCondition

public final void addCondition(IlrCondition cond)
Adds a condition to the rule. The condition passed as the argument becomes the last condition of the rule.

Parameters:
cond - The condition to be added.

removeCondition

public final void removeCondition(IlrCondition cond)
Removes a condition from the rule.

Parameters:
cond - The condition to be removed.

getConditionCount

public final int getConditionCount()
Gets the number of conditions in the rule.

Returns:
The number of conditions in the rule.

getConditions

public final IlrCondition[] getConditions()
Gets the conditions of the rule.

Returns:
An array of conditions.

setConditions

public final void setConditions(IlrCondition[] conditions)
Sets the conditions of the rule.

Parameters:
conditions - The conditions to be set.

enumerateConditions

public final Enumeration enumerateConditions()
Gets an enumeration to visit all the conditions of the rule.

Returns:
An enumeration.

addStatement

public final void addStatement(IlrStatement statement)
Adds an action to the rule. The action becomes the last action of the rule.

Parameters:
statement - The action to be added.

removeStatement

public final void removeStatement(IlrStatement statement)
Removes an action from the rule.

Parameters:
statement - The action to be removed.

getStatementCount

public final int getStatementCount()
Gets the number of actions.

Returns:
The number of actions.

getStatements

public final IlrStatement[] getStatements()
Gets the actions of the rule.

Returns:
The actions of the rule.

enumerateStatements

public final Enumeration enumerateStatements()
Gets an enumeration to visit all the actions of the rule.

Returns:
An enumeration of the rule's actions.

setStatements

public final void setStatements(IlrStatement[] statements)
Set the actions of the rule.

Parameters:
statements - The actions to be set.

addElseStatement

public final void addElseStatement(IlrStatement statement)
Appends an action to the rule's else part.

Parameters:
statement - The action to be appended.

removeElseStatement

public final void removeElseStatement(IlrStatement statement)
Removes an action from the rule's else part.

Parameters:
statement - The action to be removed.

getElseStatementCount

public final int getElseStatementCount()
Gets the number of actions in the else part. This method returns 0 when the else part does not exist or is empty.

Returns:
The number of actions in the else part.

getElseStatements

public final IlrStatement[] getElseStatements()
Gets the actions of the rule's else part.

Returns:
The actions of the rule's else part.

enumerateElseStatements

public final Enumeration enumerateElseStatements()
Gets an enumeration to visit all the actions of the rule's else part.

Returns:
An enumeration of the rule's else part.

setElseStatements

public final void setElseStatements(IlrStatement[] statements)
Sets the actions of the rule's else part.

Parameters:
statements - The actions to be set.

getPackage

public IlrPackageFactory getPackage()
Returns the package in which the rule is defined.

Returns:
The package that contains the rule.

getShortName

public String getShortName()
Gets the short name of the rule.

Returns:
The short name of the rule.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013