CER Sessions

The main data items used with CER are:

All interaction with CER rule objects and attribute values occurs within a CER Session. These interactions include the creation, retrieval and/or removal of CER rule objects, and any calculation or recalculation of attributes on rule objects.

Each CER Session is created by use of the curam.creole.execution.session.Session_Factory class.

When a CER Session is created, the following must be specified:

In turn, implementations of data storage must specify a rule object factory to use. This factory governs whether rule objects are created in a strongly-typed or interpreted-only way.

The application includes these implementations:

CAUTION:
In general you should not use more than one CER Session within one database transaction. The in-memory copies of rule objects in a CER Session are independent of in-memory copies of rule objects in all other CER Sessions.

Behavior is not guaranteed if more than one CER Session (in the same transaction) attempts to retrieve or query the same rule object from the database.

1 The ability for CER to perform recalculations directly is now superseded by the Dependency Manager (see The Dependency Manager).

The CER recalculation strategy interface and implementations are provided for backwards compatibility only.

2 Since Cúram V6, CER offers a choice of data storage implementations. These data storage implementations affect whether rule objects, created or changed in one transaction, can be retrieved and/or changed in another transactions.

Importantly, the choice of data storage does not affect the semantics of your rule expressions. This means that you can use a light-weight (in-memory) data storage for your JUnit tests (so that large numbers of JUnit tests can execute quickly), and a persistent (database) data storage for your production logic (so that rule objects are persisted across transactions), without any differences in your underlying calculations.

3 As an optimization, only external rule objects and their attribute values are retrieved from data in the Cúram database. Internal rule objects and their attributes, by their nature, can be reliably recomputed later, whereas external rule objects typically contain data from external sources and thus cannot be recomputed.
4 Note that each rule object converter is permitted to impose limits on its support for readall and readall expressions.

For example, some rule object converters may not support the execution of a readall (without a nested match), and/or place restrictions on which rule attributes can be named in the match 's retrievedattribute value.

Any violations of the rule object converter's limitations will result in an exception being thrown at runtime. You should ensure that your rule set tests include logic which invokes the rule object converters (i.e. which runs against Database Data Storage) - in contrast to the majority of your rules logic tests which will use In Memory Data Storage (and which thus do not invoke the rule object converters).

See the documentation for each rule object converter implementation to understand any limits it imposes on its support for readall.