Rule Execution Server API

ilog.rules.factory
Class IlrPackageFactory

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

public class IlrPackageFactory
extends Object
implements Serializable, ilog.rules.factory.IlrPackageElement

This class models a package in the IRL language. A package may contain local variables, rules, functions, and tasks. Each artifact contained in a package has a short name which is the artifact definition name and a fully qualified name which is the definition name prefixed with the package name.

Artifacts defined in a given package are visible in another package either if they are referenced with their fully qualified name or if their package is imported into the package that uses the artifacts.

Since:
JRules 6.0
See Also:
Serialized Form

Field Summary
 String formalComment
          This field contains the formal comment of the package.
 String name
          This field is the name of the package.
 
Method Summary
 void addFunction(IlrFunctionFactory function)
          Adds a function in the package.
 void addRule(IlrRuleFactory rule)
          Adds a rule to the rules of the package.
 void addTask(IlrTaskFactory task)
          Adds a task to the tasks of the ruleset.
 Enumeration enumerateFunctions()
          Gets an enumeration to visit all the functions of this package.
 IlrFunctionFactory[] getFunctions()
          Gets the functions of this package.
 IlrStatement[] getInitialActions()
          Deprecated.  
 IlrReflect getReflect()
          Gets the reflect object.
 IlrRuleFactory getRule(String name)
          Gets a rule factory by name.
 IlrRuleFactory[] getRules()
          Gets the rules of this package.
 IlrTaskFactory getTask(String name)
          Gets a task factory by name.
 IlrTaskFactory[] getTasks()
          Returns an array with the tasks defined in the package.
 IlrVariable getVariable(String name)
          Returns the variable that implements the variable whose name is passed as a parameter.
 Vector getVariables()
          Returns the variables defined in the package.
 boolean isDefaultPackage()
          Indicates whether this is the default package (whose name is the empty string) or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public String name
This field is the name of the package.


formalComment

public String formalComment
This field contains the formal comment of the package.

Method Detail

isDefaultPackage

public boolean isDefaultPackage()
Indicates whether this is the default package (whose name is the empty string) or not.

Specified by:
isDefaultPackage in interface ilog.rules.factory.IlrPackageElement
Returns:
true if this is the default package, else it returns false

getReflect

public final IlrReflect getReflect()
Gets the reflect object.

Returns:
The reflect object of this package factory.

getInitialActions

public final IlrStatement[] getInitialActions()
Deprecated. 

Gets the actions of the initialization rule.

Returns:
The actions of the initialization rule, or null if no initial rule has been created.

getVariable

public IlrVariable getVariable(String name)
Returns the variable that implements the variable whose name is passed as a parameter.

Parameters:
name - The name of the variable we are looking for.

getVariables

public Vector getVariables()
Returns the variables defined in the package. The variables are modelled with IlrVariable objects. The returned vector is empty in case no variable is defined in the package.

Specified by:
getVariables in interface ilog.rules.factory.IlrPackageElement
Returns:
A vector that contains the variables defined in the package.

addRule

public void addRule(IlrRuleFactory rule)
Adds a rule to the rules of the package. The rule is placed at the end of the rules.

Parameters:
rule - The rule to be added.

getRule

public IlrRuleFactory getRule(String name)
Gets a rule factory by name.

Parameters:
name - The name of the rule factory.
Returns:
A rule factory object whose name is name. When name is null, a null object is returned.

getRules

public final IlrRuleFactory[] getRules()
Gets the rules of this package.

Returns:
The rules of this package.

getTasks

public IlrTaskFactory[] getTasks()
Returns an array with the tasks defined in the package.

Returns:
An array with the package's tasks.

addTask

public void addTask(IlrTaskFactory task)
Adds a task to the tasks of the ruleset. The task is placed at the end of the tasks.

Parameters:
task - The task to be added.

getTask

public final IlrTaskFactory getTask(String name)
Gets a task factory by name.

Parameters:
name - The name of the task factory.
Returns:
A task factory object whose name is name. When name is null, a null object is returned.

addFunction

public void addFunction(IlrFunctionFactory function)
Adds a function in the package.

Parameters:
function - The function added into the package.

getFunctions

public final IlrFunctionFactory[] getFunctions()
Gets the functions of this package.

Returns:
The functions of this package.

enumerateFunctions

public final Enumeration enumerateFunctions()
Gets an enumeration to visit all the functions of this package.

Returns:
An enumeration to visit all the functions of this package.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013