Skip navigation links

Oracle Business Rules Java API Reference
10g (10.1.3.1.0)

B28966-01


oracle.rules.rl
Class RuleSession

java.lang.Object
  extended byoracle.rules.rl.RuleSession

All Implemented Interfaces:
java.io.Serializable

public class RuleSession
extends java.lang.Object
implements java.io.Serializable

RuleSession is the public API for executing Oracle Rule Language.

See Also:
Serialized Form

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_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 RL_LOGGER
           

 

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 assertXPath(java.lang.String pkg, java.lang.Object element, java.lang.String xpath)
           
 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.
 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.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.
 java.lang.String getRulesetName()
          Get the name of the implicit ruleset for top level definitions (default is "main").
 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").

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

CFG_LOCALE

public static final java.lang.String CFG_LOCALE
The key for setting the Locale for this RuleSession. a RuleSession.
See Also:
Constant Field Values

CFG_SESSION_NAME

public static final java.lang.String CFG_SESSION_NAME
The key for setting the string to use for this RuleSession.
See Also:
Constant Field Values

CFG_LOGGING

public static final java.lang.String CFG_LOGGING
The key for setting the Boolean to enable logging for this RuleSession.
See Also:
Constant Field Values

CFG_DMS

public static final java.lang.String CFG_DMS
The key for setting the Boolean to enable DMS for this RuleSession.
See Also:
Constant Field Values

CFG_APP_NAME

public static final java.lang.String CFG_APP_NAME
The key for setting the application (or component) name to associate this RuleSession with for DMS statistics.
See Also:
Constant Field Values

RL_LOGGER

public static final java.lang.String RL_LOGGER
See Also:
Constant Field Values

Constructor Detail

RuleSession

public RuleSession(java.util.Map config)
            throws RLException
Construct a new RuleSession, containing a Rete Engine and Working Memory.
Parameters:
config - session configuration parameters
Throws:
RLException

RuleSession

public RuleSession()
            throws RLException
Construct a new RuleSession, containing a Rete Engine and Working Memory. Use default locale.
Throws:
RLException

Method Detail

getOutputWriter

public java.io.Writer getOutputWriter()
Get the writer used by RL println, show, and watch functions.
Returns:
Writer

setOutputWriter

public void setOutputWriter(java.io.Writer w)
Set the writer used by RL println, show, and watch functions. Default is System.out. Default is used for new and deserialized RuleSessions.
Parameters:
w - Writer to set

getName

public java.lang.String getName()
Get the name associated with this rule session.
Returns:
rule session name

getRulesetName

public java.lang.String getRulesetName()
Get the name of the implicit ruleset for top level definitions (default is "main").
Returns:
ruleset name

setRulesetName

public void setRulesetName(java.lang.String n)
Set the name of the implicit ruleset for top level definitions (default is "main").
Parameters:
n - the implicit ruleset name

getLocale

public java.util.Locale getLocale()
Get the Locale for the rule session.
Returns:
Locale

executeRuleset

public void executeRuleset(java.lang.String rulesetString)
                    throws RLException
Execute the ruleset
Parameters:
rulesetString - String containing ruleset text
Throws:
RLException

executeRuleset

public void executeRuleset(java.io.Reader rulesetReader)
                    throws RLException
Execute the ruleset
Parameters:
rulesetReader - Reader containing ruleset text
Throws:
RLException

callFunction

public java.lang.Object callFunction(java.lang.String functionName)
                              throws RLException
Execute the RL function with no arguments, returning result.
Parameters:
functionName - name of RL function, optionally ruleset-qualified
Returns:
Object result of RL function
Throws:
RLException

callFunctionWithArgument

public java.lang.Object callFunctionWithArgument(java.lang.String functionName,
                                                 java.lang.Object arg)
                                          throws RLException
Execute the RL function with one argument, returning result.
Parameters:
functionName - name of RL function, optionally ruleset-qualified
arg - Object to pass to function
Returns:
Object result of RL function
Throws:
RLException

callFunctionWithArgumentArray

public java.lang.Object callFunctionWithArgumentArray(java.lang.String functionName,
                                                      java.lang.Object[] args)
                                               throws RLException
Execute the RL function with given array arguments, returning result.
Parameters:
functionName - name of RL function, optionally ruleset-qualified
args - array of arguments to pass to function
Returns:
Object result of RL function
Throws:
RLException

callFunctionWithArgumentList

public java.lang.Object callFunctionWithArgumentList(java.lang.String functionName,
                                                     java.util.List args)
                                              throws RLException
Execute the RL function with given list of arguments, returning result.
Parameters:
functionName - name of RL function, optionally ruleset-qualified
args - list to pass to function
Returns:
Object result of RL function
Throws:
RLException

assertXPath

public void assertXPath(java.lang.String pkg,
                        java.lang.Object element,
                        java.lang.String xpath)
                 throws RLException
Throws:
RLException

parseRuleset

public RuleSession.ParsedRulesetInfo parseRuleset(java.lang.String rulesetString)
                                           throws RLException
Parse and return info about the given ruleset. Info includes JAXB parse tree, names and definitions for all classes, functions, and variables organized by ruleset, and java classes appearing in fact context in this ruleset, organized by package.
Returns:
ParsedRulesetInfo
Throws:
RLException

parseRuleset

public RuleSession.ParsedRulesetInfo parseRuleset(java.io.Reader rulesetReader)
                                           throws RLException
Throws:
RLException

getFactObjects

public java.util.Iterator getFactObjects()
Get an Iterator over the objects that have been asserted as facts in working memory.
Returns:
Iterator

getFactIds

public java.util.Iterator getFactIds()
Get an 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.
Returns:
Iterator

Skip navigation links

Oracle Business Rules Java API Reference
10g (10.1.3.1.0)

B28966-01


Copyright © 2006, Oracle. All rights reserved.