Package ilog.rules.res.session
See: Description
-
Interface Summary Interface Description IlrManagementSession IlrManagementSession
is the base interface for management sessions.IlrSession IlrSession
is the top-level markup interface for sessions.IlrSessionFactory IlrSessionFactory
is the interface implemented by all rule session factories.IlrSessionRequest IlrSessionRequest
is the interface for session requests.IlrSessionResponse IlrSessionResponse
encapsulates the response to a stateless rule session invocation or to an execute of a stateful rule session invocation.IlrStatefulSession IlrStatefulSession
represents a stateful rule session.IlrStatefulSessionEJB IlrStatefulSessionEJB
is an interface implemented by stateful rule session EJB3 components.IlrStatelessSession IlrStatelessSession
represents a stateless rule session.IlrTraceFilter Use the classIlrTraceFilter
to select the information that you want to see in the execution trace.IlrWarning UseIlrWarning
for warnings emitted by a rule session.IlrXUInfo Represents the XU information which can help to analyze performance issues (state of the connections, cache, rulesets statistics, ...). -
Class Summary Class Description IlrEJB3SessionFactory IlrEJB3SessionFactory
is a session factory for EJB3 rule sessions.IlrJ2SESessionFactory TheIlrJ2SESessionFactory
class is a rule session factory for Java SE environments.IlrPOJOSessionFactory Use theIlrPOJOSessionFactory
class to create sessions in Java EE environments. -
Exception Summary Exception Description IlrRuleServiceException Exception thrown to indicate an error during the use ofilog.rules.res.session.IlrRuleService
.IlrSessionCreationException AnIlrSessionCreationException
exception is raised when an error occurs during rule session creation.IlrSessionException AnIlrSessionException
exception is raised if a problem occurs during the execution of a rule session method.
Package ilog.rules.res.session Description
Provides the core classes and interfaces to manage Decision Server rule sessions. Rule sessions provide an API on top of the Decision Server execution stack, that is, the Execution Unit (XU) and rule engine. Use this API to call rulesets and management operations.
Overview
Rule Execution Server is an environment for executing rules. It provides management, performance, security, and logging capabilities. Using Rule Execution Server, you can dynamically change the business logic in both Java SE and Java EE environments.
The Rule Execution Server architecture is based on a number of independent, but cooperating, software modules.
Rule sessions
A rule session is a runtime connection between a client and a rule engine. It is associated with a single ruleset and consumes rule engine resources. Rule sessions use a factory interface so that client applications can reference implementations of a session.
A rule session:
- Provides a mechanism to access the list of all the rulesets registered with the provider.
- Defines the type of the session that a client establishes: stateful or stateless.
- Manages a class loader to enable the Execution Unit (XU) to execute a ruleset on any XOM.
- Provides a service to handle XML parameters. This service is important because you cannot and should not access the reflect or an XML data driver on the application side.
Rule sessions are either stateless or stateful. The following rule session types are provided:
- Java SE: for Java SE environments or Web-only containers. This rule session embeds the Java SE Execution Unit (XU).
- POJO: for Java EE environments with a simple Java object model. This rule session uses the Java EE XU.
- EJB: for Java EE environments used as Enterprise Java Beans. This rule session uses the Java EE XU.
- MDB: for asynchronous execution in Java EE containers using Message-Driven Beans/JMS. This rule session uses the Java EE XU.
Ruleset execution path
A ruleset execution path is used in Rule Execution Server to locate a deployed RuleApp and ruleset.
The path is composed of:
/{RuleApp name}[/{version}]/{ruleset name}[/{version}]
where:
- {RuleApp name} or {ruleset name} can be composed of digits, letters, and underscores. Both names are mandatory.
- /{version} is optional. If the version is not specified, it is the latest activated version of the RuleApp or the ruleset.
- {version} is equivalent to: {number}.{number}
Examples of valid ruleset paths are:
/rule8_8app/6_ruleset_6/1.0
/rule8_8app/1.0/6_ruleset_6
/rule8_8app/6_ruleset_6
/rule8_8app/1.0/6_ruleset_6/1.0
Code example
In the following code example, you use the IlrSessionFactory
object to create and access
rule sessions after a rule session factory has been instantiated
for the target environment:
// create rule session factory IlrSessionFactory sessionFactory = new IlrPOJOSessionFactory(); // use stateless session for invocation IlrStatelessSession statelessSession = sessionFactory.createStatelessSession(); statelessSession....(); // use stateful session for invocation IlrStatefulSession statefulSession = sessionFactory.createStatefulSession(...); try { statefulSession....(); } finally { statefulSession.close(); } // use management session IlrManagementSession managementSession = sessionFactory.createManagementSession(); managementSession....();