|
Oracle Fusion Middleware Java API Reference for Oracle Business Rules 11g Release 1 (11.1.1) E10663-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.rules.rl.RuleSession
public class RuleSession
RuleSession is the public API for executing Oracle Rule Language.
Nested Class Summary | |
---|---|
class |
RuleSession.ParsedRulesetInfo ParsedRulesetInfo -- a bean for holding the result of a parse |
Field Summary | |
---|---|
static java.lang.String |
CFG_APP_NAME The key for setting the application (or component) name to associate this RuleSession with for DMS statistics. |
static java.lang.String |
CFG_DECISION_TRACE_LEVEL The key for specifying the decision trace level at RuleSession instantiation. |
static java.lang.String |
CFG_DECISION_TRACE_LIMIT The key for specifying the decision trace limit at RuleSession instantiation. |
static java.lang.String |
CFG_DMS The key for setting the Boolean to enable DMS for this RuleSession. |
static java.lang.String |
CFG_LOCALE The key for setting the Locale for this RuleSession. |
static java.lang.String |
CFG_LOGGING The key for setting the Boolean to enable logging for this RuleSession. |
static java.lang.String |
CFG_SESSION_NAME The key for setting the string to use for this RuleSession. |
static java.lang.String |
CFG_WATCH The key for specifying the watch options at RuleSession instantiation. |
static int |
DECISION_TRACE_DEVELOPMENT The decision trace level to use for debugging or more detailed tracing. |
static int |
DECISION_TRACE_OFF The decision trace level that disables decision tracing. |
static int |
DECISION_TRACE_PRODUCTION The decision trace level for use in production. |
static java.lang.String |
RL_LOGGER |
static int |
WATCH_ACTIVATIONS Watch the addition or removal of activations from the agenda. |
static int |
WATCH_ALL Watch all rule engine activity. |
static int |
WATCH_COMPILATIONS Watch rule compilation into the Rete network. |
static int |
WATCH_FACTS Watch the assertion, retraction, or modification of facts in working memory. |
static int |
WATCH_FOCUS Watch ruleset stack changes. |
static int |
WATCH_RULES Watch rules fire. |
Constructor Summary | |
---|---|
RuleSession() Construct a new RuleSession, containing a Rete Engine and Working Memory. |
|
RuleSession(java.util.Map config) Construct a new RuleSession, containing a Rete Engine and Working Memory. |
Method Summary | |
---|---|
void |
assertTree(java.lang.Object root) Asserts as facts objects from an object tree. |
void |
assertTree(java.lang.String spec, java.lang.Object root) Asserts as facts objects from an object tree. |
void |
assertXPath(java.lang.String pkg, java.lang.Object element, java.lang.String xpath) Deprecated. |
java.lang.Object |
callFunction(java.lang.String functionName) Execute the RL function with no arguments, returning result. |
java.lang.Object |
callFunctionWithArgument(java.lang.String functionName, java.lang.Object arg) Execute the RL function with one argument, returning result. |
java.lang.Object |
callFunctionWithArgumentArray(java.lang.String functionName, java.lang.Object[] args) Execute the RL function with given array arguments, returning result. |
java.lang.Object |
callFunctionWithArgumentList(java.lang.String functionName, java.util.List args) Execute the RL function with given list of arguments, returning result. |
java.lang.Object |
callFunctionWithArguments(java.lang.String functionName, java.lang.Object... args) Execute the RL function with given arguments, returning result. |
void |
executeRuleset(java.io.Reader rulesetReader) Execute the ruleset |
void |
executeRuleset(java.lang.String rulesetString) Execute the ruleset |
java.util.Iterator |
getFactIds() Get an Iterator over the fact IDs for the objects that have been asserted as facts in working memory. |
java.util.Iterator |
getFactObjects() Get an Iterator over the objects that have been asserted as facts in working memory. |
java.util.Iterator |
getFactObjects(ObjectFilter filter) Get an Iterator over the objects in working memory that pass the specified filter. |
java.util.Locale |
getLocale() Get the Locale for the rule session. |
java.lang.String |
getName() Get the name associated with this rule session. |
java.io.Writer |
getOutputWriter() Get the writer used by RL println, show, and watch functions. |
Ruleset |
getRuleset(java.lang.String name) Returns the Ruleset for the ruleset with the specified name. |
java.lang.String |
getRulesetName() Get the name of the implicit ruleset for top level definitions (default is "main"). |
java.util.Map<java.lang.String,Ruleset> |
getRulesets() Returns a Map containig a String ,Ruleset key,value pair for each ruleset defined in this RuleSession . |
java.lang.Object |
getVariable(java.lang.String name) Returns the value of the specified RL global variable. |
boolean |
isSupportsXPathEnabled() Returns true if "supports xpath" is enabled (the default). |
boolean |
isValid() Returns true if this RuleSession is valid. |
RuleSession.ParsedRulesetInfo |
parseRuleset(java.io.Reader rulesetReader) |
RuleSession.ParsedRulesetInfo |
parseRuleset(java.lang.String rulesetString) Parse and return info about the given ruleset. |
void |
setOutputWriter(java.io.Writer w) Set the writer used by RL println, show, and watch functions. |
void |
setRulesetName(java.lang.String n) Set the name of the implicit ruleset for top level definitions (default is "main"). |
boolean |
setSupportsXPathEnabled(boolean newValue) Enables (disables) "supports xpath" by specifying a new value of true (false). |
void |
setVariable(java.lang.String name, java.lang.Object value) Sets the value of the specified RL global variable. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CFG_LOCALE
public static final java.lang.String CFG_SESSION_NAME
public static final java.lang.String CFG_LOGGING
public static final java.lang.String CFG_DMS
public static final java.lang.String CFG_APP_NAME
public static final java.lang.String CFG_WATCH
Integer watchConfig = Integer.valueOf(RuleSession.WATCH_RULES | RuleSession.WATCH_FACTS); configMap.put(RuleSession.CFG_WATCH, watchConfig);
reset
function.RuleSession.WATCH_RULES
, RuleSession.WATCH_ACTIVATIONS
, RuleSession.WATCH_FACTS
, RuleSession.WATCH_FOCUS
, RuleSession.WATCH_COMPILATIONS
, RuleSession.WATCH_ALL
, Constant Field Valuespublic static final int WATCH_RULES
RuleSession.CFG_WATCH
, Constant Field Valuespublic static final int WATCH_ACTIVATIONS
RuleSession.CFG_WATCH
, Constant Field Valuespublic static final int WATCH_FACTS
RuleSession.CFG_WATCH
, Constant Field Valuespublic static final int WATCH_FOCUS
RuleSession.CFG_WATCH
, Constant Field Valuespublic static final int WATCH_COMPILATIONS
RuleSession.CFG_WATCH
, Constant Field Valuespublic static final int WATCH_ALL
RuleSession.CFG_WATCH
, Constant Field Valuespublic static final java.lang.String CFG_DECISION_TRACE_LEVEL
RuleSession.DECISION_TRACE_OFF
, RuleSession.DECISION_TRACE_PRODUCTION
, RuleSession.DECISION_TRACE_DEVELOPMENT
, Constant Field Valuespublic static final int DECISION_TRACE_OFF
public static final int DECISION_TRACE_PRODUCTION
public static final int DECISION_TRACE_DEVELOPMENT
public static final java.lang.String CFG_DECISION_TRACE_LIMIT
public static final java.lang.String RL_LOGGER
Constructor Detail |
---|
public RuleSession(java.util.Map config) throws RLException
config
- session configuration parametersRLException
public RuleSession() throws RLException
RLException
Method Detail |
---|
public java.io.Writer getOutputWriter()
public void setOutputWriter(java.io.Writer w)
w
- Writer to setpublic java.lang.String getName()
public java.lang.String getRulesetName()
public void setRulesetName(java.lang.String n)
n
- the implicit ruleset namepublic java.util.Locale getLocale()
public void executeRuleset(java.lang.String rulesetString) throws RLException
rulesetString
- String containing ruleset textRLException
public void executeRuleset(java.io.Reader rulesetReader) throws RLException
rulesetReader
- Reader containing ruleset textRLException
public java.lang.Object callFunction(java.lang.String functionName) throws RLException
functionName
- name of RL function, optionally ruleset-qualifiedRLException
public java.lang.Object callFunctionWithArgument(java.lang.String functionName, java.lang.Object arg) throws RLException
functionName
- name of RL function, optionally ruleset-qualifiedarg
- Object to pass to functionRLException
public java.lang.Object callFunctionWithArgumentArray(java.lang.String functionName, java.lang.Object[] args) throws RLException
functionName
- name of RL function, optionally ruleset-qualifiedargs
- array of arguments to pass to functionRLException
public java.lang.Object callFunctionWithArguments(java.lang.String functionName, java.lang.Object... args) throws RLException
functionName
- name of RL function, optionally ruleset-qualifiedargs
- vararg arguments to pass to functionRLException
public java.lang.Object callFunctionWithArgumentList(java.lang.String functionName, java.util.List args) throws RLException
functionName
- name of RL function, optionally ruleset-qualifiedargs
- list to pass to functionRLException
public void assertTree(java.lang.Object root) throws RLException
root
- the root of the object tree.RLException
- if an error occurs asserting the object treepublic void assertTree(java.lang.String spec, java.lang.Object root) throws RLException
spec
argument is a colon separated list of package names and controls which objects are asserted. If an object in the tree is in one of the packages in the list, it will be asserted and assertTree will recurse over its bean properties.spec
- a list of colon separated packages.root
- the root of the object tree.RLException
- if an error occurs asserting the object tree
@Deprecated
public void assertXPath(java.lang.String pkg,
java.lang.Object element,
java.lang.String xpath)
throws RLException
RLException
public RuleSession.ParsedRulesetInfo parseRuleset(java.lang.String rulesetString) throws RLException
RLException
public RuleSession.ParsedRulesetInfo parseRuleset(java.io.Reader rulesetReader) throws RLException
RLException
public java.util.Iterator getFactObjects()
Iterator
over the objects that have been asserted as facts in working memory.public java.util.Iterator getFactObjects(ObjectFilter filter)
Iterator
over the objects in working memory that pass the specified filter.public java.util.Iterator getFactIds()
Iterator
over the fact IDs for the objects that have been asserted as facts in working memory. Each fact ID (an int
, is wrapped in an Integer
.public Ruleset getRuleset(java.lang.String name)
Ruleset
for the ruleset with the specified name.name
- the ruleset name.Ruleset
for the ruleset with the specified name.public java.util.Map<java.lang.String,Ruleset> getRulesets()
Map
containig a String
,Ruleset
key,value pair for each ruleset defined in this RuleSession
.Ruleset
's.public boolean setSupportsXPathEnabled(boolean newValue)
false
before any RL is executed. If "supports xpath" is disabled:
newValue
- the new valuepublic boolean isSupportsXPathEnabled()
public java.lang.Object getVariable(java.lang.String name) throws RLException
RLException
- if no such global variable exists.public void setVariable(java.lang.String name, java.lang.Object value) throws RLException
RLException
- if no such global variable exists or if the specified value can not be assigned to the variable.public boolean isValid()
|
Oracle Fusion Middleware Java API Reference for Oracle Business Rules 11g Release 1 (11.1.1) E10663-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |