|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.factory.IlrTaskFactory ilog.rules.factory.IlrRuleTaskFactory
public class IlrRuleTaskFactory
A rule-based task definition of the ILOG Rule Language. It provides the settings specific to a rule-based task, such as:
IlrRuleTaskFactory
,
IlrFunctionTaskFactory
,
IlrFlowTaskFactory
,
Serialized Form
Constructor Summary | |
---|---|
IlrRuleTaskFactory(IlrReflect reflect,
IlrPackageFactory pkg,
String name)
Builds a rule-based task by specifying a reflect and a name. |
|
IlrRuleTaskFactory(IlrReflect reflect,
String name)
Deprecated. Use instead IlrRuleTaskFactory(IlrReflect reflect, IlrPackageFactory pkg,
String name) . |
Method Summary | |
---|---|
void |
addGroupInRules(String groupName)
Adds a group in the rules list. |
void |
addGroupInScope(String groupName)
Adds a group to the task scope. |
void |
addMatchOnClass(IlrClass clazz)
Adds a class to the list on which the sequential iterator will operate. |
void |
addPackageInRules(IlrPackageFactory pkgF)
Adds a package in the rules list. |
void |
addPackageInScope(IlrPackageFactory pkg)
Adds a package to the task scope. |
void |
addRule(String rule)
Adds a rule to the rule-based task body. |
void |
addScope(String ruleName)
Adds a rule, specified by its name, in the task scope. |
void |
checkRuleTaskConsistency()
Checks if the rule-based task is correctly defined, which means whether its definition contains incompatible settings or not. |
IlrValue |
getAgendaFilter()
Returns the agenda filter defined on the rule-based task. |
IlrFunctionFactory |
getAgendaFilterFunction()
Returns the agenda filter defined on the rule-based task. |
int |
getAlgorithm()
Returns the algorithm that determines how the rules are fired. |
ArrayList |
getAllStatements()
Provides all statements referenced by the task definition. |
ArrayList |
getAllValues()
Provides all values referenced by the task definition. |
IlrValue |
getDomainValue()
Deprecated. Use instead getScope(). |
boolean |
getDynamicBody()
Indicates whether the rule-based task has a dynamic body or not. |
int |
getFiring()
Returns the firing parameter value defined on the
rule-based task. |
int |
getFiringLimit()
Returns the firinglimit parameter value defined on
the rule-based task. |
IlrValue |
getIterator()
Returns the iterator used in a sequential algorithm rule task. |
Vector |
getMatchOnClasses()
Returns the vector of object classes on which the iterator will iterate. |
IlrValue |
getMatchOnValue()
Returns the object classes on which the iterator will iterate. |
int |
getOrdering()
Returns the ordering parameter value defined on the
rule-based task. |
Vector |
getRules()
Returns the rules that compose the rule-based task body. |
IlrFunctionFactory |
getRuleSelector()
Returns the rule-based task body if this one has been defined as a function factory (and not by explicitly listing the rules that compose the body). |
ArrayList |
getScope()
Returns the task scope. |
IlrScopeValue |
getScopeValue()
Returns the scope value attached to the task. |
boolean |
hasEmptyBody()
Indicates whether the task has an empty body or not, that is, if neither a no rules list nor a rule selector has been given to the task. |
boolean |
removeRule(String rule)
Removes a rule from the rule-based task body. |
void |
setAgendaFilter(IlrFunctionFactory agendaFilter)
Sets the agenda filter to the rule-based task. |
void |
setAgendaFilter(IlrValue agendaFilter)
Sets the agenda filter to the rule-based task. |
void |
setAlgorithm(int algo)
Sets the algorithm that determines how the rules are fired. |
void |
setDomainValue(IlrValue value)
Deprecated. Use instead addScope(String ruleName) ,
addPackageInScope(String pkgName) or
addPackageInScope(IlrPackageFactory pkg) . |
void |
setDynamicBody(boolean dynamic)
Sets the Boolean value that tells whether the rule-based task has a dynamic body or not. |
void |
setFiring(int firing)
Sets the value of the firing parameter of the rule-based
task. |
void |
setFiringLimit(int firingLimit)
Sets the value of the firinglimit parameter of the
rule-based task. |
void |
setIterator(IlrValue iterator)
Sets the iterator used in a sequential algorithm rule task. |
void |
setMatchOnValue(IlrValue value)
Sets as a value the list of ordered classes of the object instances on which the iterator will iterate. |
void |
setOrdering(int ordering)
Sets the value of the ordering parameter of the rule-based
task. |
void |
setRuleSelector(IlrFunctionFactory function)
Sets the rule-based task body. |
void |
setScopeValue(IlrScopeValue value)
Sets the scope value attached to the task. |
Methods inherited from class ilog.rules.factory.IlrTaskFactory |
---|
getCompletionFlagValue, getFinalActions, getFormalComment, getInitialActions, getName, getPackage, getProperties, getShortName, setCompletionFlagValue, setFinalActions, setFormalComment, setInitialActions, setProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IlrRuleTaskFactory(IlrReflect reflect, String name)
IlrRuleTaskFactory(IlrReflect reflect, IlrPackageFactory pkg,
String name)
.
null
and the body is empty.
reflect
- The reflect object of this rule-based task factory.name
- The name of the rule-based task.public IlrRuleTaskFactory(IlrReflect reflect, IlrPackageFactory pkg, String name)
null
,
the task is considered to belong to the default package.
The default settings are:
reflect
- The reflect object of this rule-based task factory.pkg
- The package to which the task belongs.name
- The name of the rule-based task.Method Detail |
---|
public void addPackageInRules(IlrPackageFactory pkgF)
pkgF
- The package whose rules are added to the task body.public void addGroupInRules(String groupName)
groupName
- The name of the group whose rules are added
to the task body.public void addRule(String rule)
rule
- The name of the added rule.public boolean removeRule(String rule)
rule
- The name of the rule to be removed.
true
if the rule was a component of the task,
false
otherwise.public Vector getRules()
setRuleSelector(IlrFunctionFactory)
public void setRuleSelector(IlrFunctionFactory function)
null
, and it must
return a boolean
and take an argument of
IlrRule
type. In case any of these conditions is not
verified, an IllegalArgumentException
is thrown.
This allows you to compute the final body by calling
the function for each rule of the ruleset (the one in which the
rule-based task is defined). If the returned value is true
,
the rule is added in the rule-based task body, otherwise it is not.
function
- The function factory that contains the code to compute
the rule-based task body.public IlrFunctionFactory getRuleSelector()
addRule(String)
public void setDomainValue(IlrValue value)
addScope(String ruleName)
,
addPackageInScope(String pkgName)
or
addPackageInScope(IlrPackageFactory pkg)
.
ilog.rules.engine.IlrRule[]
.
In case any of these conditions is not
satisfied, an IllegalArgumentException
is thrown.
When a domain value is specified, the dynamic body code iterates on the
array of rules instead of iterating on the whole ruleset.
value
- The value that represents a domain.public IlrValue getDomainValue()
public void setAgendaFilter(IlrValue agendaFilter)
ilog.rules.engine.IlrAgendaFilter
.
agendaFilter
- The value that represents the agenda filter object.public IlrValue getAgendaFilter()
IlrAgendaFilter
class.
public void setAgendaFilter(IlrFunctionFactory agendaFilter)
ilog.rules.engine.IlrRuleInstance
. In case any of these
conditions is not verified, an IllegalArgumentException
is thrown.
agendaFilter
- The function that implements the agenda filter.public IlrFunctionFactory getAgendaFilterFunction()
public void setOrdering(int ordering)
ordering
parameter of the rule-based
task. This parameter specifies the rule ordering strategy of the task.
The possible values are
IlrRulesetConstants.Dynamic
,
IlrRulesetConstants.Literal
, or
IlrRulesetConstants.Sorted
.
A wrong value throws an IllegalArgumentException
.
ordering
- The ordering parameter value.public int getOrdering()
ordering
parameter value defined on the
rule-based task.
public void setFiring(int firing)
firing
parameter of the rule-based
task. This parameter specifies the rule firing strategy of the task.
The possible values are
IlrRulesetConstants.Rule
or
IlrRulesetConstants.AllRules
.
A wrong value throws an IllegalArgumentException
.
firing
- The firing parameter value.public int getFiring()
firing
parameter value defined on the
rule-based task.
public void setFiringLimit(int firingLimit)
firinglimit
parameter of the
rule-based task. This parameter specifies how many rules will be fired
when at the task execution. The firinglimit
value must
be a positive integer. If this condition is not verified, an
IllegalArgumentException
is thrown.
firingLimit
- The number of rules to be fired.public int getFiringLimit()
firinglimit
parameter value defined on
the rule-based task.
public void setIterator(IlrValue iterator)
IlrTupleIterator
.
iterator
- The iterator used to compute the objects on which
the rules of the sequential algorithm rule task will match.public IlrValue getIterator()
public void setAlgorithm(int algo)
algo
- The rule task algorithm.public int getAlgorithm()
public void setMatchOnValue(IlrValue value)
value
- The classes as a value used by the iterator.public IlrValue getMatchOnValue()
public void addMatchOnClass(IlrClass clazz)
clazz
- The class to add to the vector of classes used
by the iterator.public Vector getMatchOnClasses()
public void setDynamicBody(boolean dynamic)
dynamic
- The Boolean value that determines whether the rule-based task
body will be dynamically computed or not.public boolean getDynamicBody()
true
if the rule-based task body is dynamic,
or false
otherwise.public void addScope(String ruleName)
ruleName
- The name of the rule to be added in the scope.public void addPackageInScope(IlrPackageFactory pkg)
pkg
- The package added to the task scope.public void addGroupInScope(String groupName)
groupName
- The group added to the task scope.public ArrayList getScope()
public void setScopeValue(IlrScopeValue value)
?scope
value, accessible in the
task rule selector.
value
- The scope value attached to the task.public IlrScopeValue getScopeValue()
public void checkRuleTaskConsistency()
public boolean hasEmptyBody()
hasEmptyBody
in class IlrTaskFactory
true
if the task body is empty, or
false
otherwise.public ArrayList getAllValues()
getAllValues
in class IlrTaskFactory
public ArrayList getAllStatements()
getAllStatements
in class IlrTaskFactory
|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |