Decision Center API

Package ilog.rules.teamserver.model

Defines the API you use to access and control Decision Center data and services.

See:
          Description

Interface Summary
ActivityLockingFacility Provides change activity locking facilities.
IlrBaselineManagementFacility Baseline management services for a Decision Center session.
IlrDeploymentFacility Deployment services for a Decision Center session, allowing to generate and deploy rulesets and RuleApps.
IlrElementDetails Details of a Decision Center element.
IlrElementHandle Handle on an element in Decision Center.
IlrElementSummary Summary of a Decision Center element.
IlrIsUserInRoleCallback A callback with a single method to determine the roles of the current user.
IlrLockingFacility Locking services provided by a Decision Center session.
IlrModelConstants Decision Center constants.
IlrQueryableElement Describes the type of objects that are inserted in the JRules engine working memory for executing all query actions and conditions that have no SQL equivalent.
IlrSearchCriteria IlrSearchCriteria is the base interface for all classes that specify search criteria to pass to the IlrSession findElements search methods.
IlrSession Allows you to connect a registered user to Decision Center.
IlrSessionCallback Root interface for callbacks to be called by IlrSession implementations.
IlrSessionController IlrSessionController is the base interface for all classes that define security settings and interactive behavior for Decision Center.
IlrSessionFactory A static object used to connect a registered user to Decision Center and get a corresponding IlrSession instance.
IlrTestingFacility Testing services for a Decision Center session, allowing to execute and generate a test suite or simulation archive.
SessionListener Defines an object which listens for session events.
 

Class Summary
BranchHelper BranchHelper handles branch specific operations.
Change Description of a change on an element between two branches.
CommitEvent Used to notify interested parties that an object has been committed in Decision Center.
DeleteEvent Used to notify interested parties that an object has been deleted in Decision Center.
IlrArchiveOutput Result object returned when generating a ruleset or RuleApp archive.
IlrBusinessVersion Version of a Decision Center.
IlrCommitableObject Holds an element to commit in the database along with its details and/or a list of its contained elements to add or delete during the commit.
IlrDefaultIsUserInRoleCallback Default implementation of IlrIsUserInRoleCallback.
IlrDefaultSearchCriteria IlrDefaultSearchCriteria is the default implementation of IlrSearchCriteria.
IlrDefaultSessionController IlrDefaultSessionController is the default session controller implementation used by Decision Center.
IlrElementError A Decision Center error created when generating a ruleset archive, checking a ruleset archive, committing an object, and so on.
IlrElementVersion Version of a Decision Center.
IlrModelInfo Contains information on the Decision Center model.
IlrRuleAppDeploymentOperation A RuleApp deployment operation represents an operation done on a RuleApp during deployment on the Rule Execution Server.
IlrRuleAppDeploymentReport RuleApp deployment report.
IlrSessionHelper IlrSessionHelper contains a set of helper methods that you use to manipulate Decision Center services and data.
IlrSettings Provides a set of methods to save and retrieve Decision Center settings.
MergeOperation Description of a change between two branches.
SessionEvent Abstract class for events that notifies a change of an element in Decision Center.
 

Enum Summary
Change.Status Status attached to the change.
MergeOperation.Action List of actions that can be applied to the MergeOperation elements.
 

Exception Summary
IlrActivityObjectLockedException Thrown when an object is locked by an other Change Activity in the same Release, and prevents a write operation.
IlrApplicationException Root exception class for business exceptions happening on the server when using the client API (this API).
IlrArchiveGenerationException Thrown when the level of an error that occurred during ruleset archive generation is greater or equal to the level specified in project options.
IlrCannotCompareDeleteVersionException Thrown when one try to compare two versions of an element and one version is marked as 'deleted'.
IlrCannotDeleteException Thrown when one try to delete an element that is still referenced by other elements.
IlrCannotRestoreDeleteVersionException Thrown when one try to restore a version of an element that has been marked as 'deleted'.
IlrConcurrentModificationException  
IlrConnectException Thrown when a user fails to connect to the server using an implementation of IlrSessionFactory.
IlrElementBaselineNotFoundException This exception is thrown when the system cannot find a baseline for a given element matching either the working baseline or one of its dependent baselines.
IlrFolderLockedException Thrown when a folder is locked and prevents an operation.
IlrFrozenBaselineException Thrown when one try to manipulate (add / remove elements) a baseline which is frozen.
IlrInvalidElementException Thrown when an element is invalid.
IlrKnownUUIDException Thrown when trying to commit a new project element with a UUID that is already the UUID of an existing element in the Decision Center repository.
IlrObjectLockedException Thrown when an object is locked and prevents a write operation.
IlrObjectNotFoundException Thrown if a Decision Center object does not exist in the database.
IlrObjectNotLockedException Thrown when trying to unlock an object that is no locked.
IlrObjectNotRootLockException Thrown when trying to unlock an object and it is already participating in a lock initiated by a higher package in the package hierarchy.
IlrProjectBaselineNotFoundException This exception is thrown when the system cannot find a baseline for a given project matching either the working baseline or one of its dependent baselines.
IlrProjectEltBaselineNotFoundException This exception is thrown when the system cannot find a baseline for a given project element matching either the working baseline or one of its dependent baselines.
IlrReadOnlyException Thrown when one tries to set a value for a feature that is read-only.
 

Package ilog.rules.teamserver.model Description

Defines the API you use to access and control Decision Center data and services.

Overview

ILOG Decision Center is a rule management server and repository integrated into a J2EE application server. It is used for authoring, managing, validating, and deploying rule projects containing business rules. IlrSession is the main entry point to Decision Center. You use this class to do the following:

An element in Decision Center is any object contained in a rule project. For example, a rule, a ruleflow, a decision table, a business object model, a query or a template. The Eclipse Modeling Framework (EMF) is used in Decision Center to define the rule model, that is, the set of elements that are managed in a rule project, and their associated properties. All elements are instances of an EMF class defined by the EClass interface. Properties are represented by the EStructuralFeature interface. Call getPropertyValue(String) and getPropertyValue(EStructuralFeature) to retrieve the property values of an element. See the EMF documentation for more information.

All rule artifacts are instances of the IlrElement interface. You manipulate Decision Center artifacts using the following interfaces:

NameDescriptionScope
IlrElementHandle the base interface for all elements retrieve from server
IlrElementSummary contains the name of the element only, mainly used for GUI applications retrieve from server
IlrElementDetails contains all information contained in an element, can be cast directly to a type such as IlrRule retrieve from server
IlrCommitableObject any element that will be added to the repository add to server

Use an IlrSessionFactory instance to connect to the Decision Center, you then retrieve an IlrSession instance by calling IlrSessionFactory.getSession.

All session objects are stateful, that is, they are always associated with the user whose credentials were given when connect was called. See IlrSession for a code example of how to create a user session using the API.

Rule Projects

A rule project corresponds to a specific organization of rules. Rule projects are stored in the repository. A repository can contain many rule projects, but rule projects are displayed one at a time in Decision Center. Rule projects can, however, be set up to reference other projects in the repository. The following code example shows how to create an empty rule project using the API:

         //Create Project
         String projectName = "testProject";
         IlrRuleProject testProject = null;
         IlrRuleProject workingProject = 
                (IlrRuleProject)IlrSessionHelper.getProjectNamed(session, projectName);
         if (workingProject!=null) {
           testProject = workingProject;
           session.eraseProject(testProject);
           System.out.println("Project Deleted"); 
         }
         testProject = 
           (IlrRuleProject)IlrSessionHelper.createRuleProject(
                        session, projectName);
 

Note: this code example uses IlrSessionHelper to interact with Decision Center.

Versions and Baselines

Decision Center keeps track of all the changes made to any project element by storing all the versions of each element.

Baselines correspond to a snapshot of the state of a project at a given moment in time. A project can contain many baselines, all of which you can consult. You can restore a baseline if required.

When a user connects to Decision Center, for your custom application to work correctly, it is essential that you set the baseline for the current user. The following code example shows how to set the baseline for a user:

  String project = "loanvalidation-rules";
  // get the project by name
  IlrRuleProject ruleProject = (IlrRuleProject) IlrSessionHelper.getProjectNamed(session, project);
  // open current baseline
  IlrBaseline currentBaseline = IlrSessionHelper.getCurrentBaseline(session, ruleProject);
  session.setWorkingBaseline(currentBaseline);

The following code example shows how to create a baseline from the state of the elements in the current rule project.

   Date today = new Date();
   String baselineName = "testBaseline" + today.toString();
   IlrBaseline newBaseline = session.createBaselineFromCurrentState(baselineName);
 
See
IlrSession for a more complete example.

Project Security and User Behavior

Decision Center security means restricting user access to a given project. When security is not enforced on a project, any user of Decision Center can create, update, view or delete any of the elements in that project. When you enforce security on a project, you specify which groups can access the project. When a user signs in, Decision Center evaluates what the user can do, based on which groups the current user belongs to. The default groups are as follows:

UserDescription
rtsUser Can manipulate data in the Explore, Query, and Compose tabs
rtsConfigManager Has rtsUser rights plus control of configuration data in the Configure tab
rtsAdministrator Has full control of all aspects of Decision Center

When the current user tries to modify an element inside a rule project using either the web GUI or via a custom application, session controller methods are called to control the way Decision Center reacts. The default session controller implementation used by Decision Center is IlrDefaultSessionController.

You customize the security settings of Decision Center by creating a subclass of IlrDefaultSessionController. For example, you can create a custom session controller that logs the actions of each user to a file or database. See IlrSessionController for an example of of how to create a custom session controller.

In order for Decision Center to take your customized session controller into account, you must register your new implementation in one of the following ways:

Note: You should create a subclass of IlrDefaultSessionController when you customize Decision Center behavior and not IlrSessionController directly.

You need at least rtsConfigManager rights to:

Also, you need at least rtsAdministrator rights to:

However, note that when using the IlrSession API, some actions are less restrictive than when using the Decision Center Console. Specifically, the rtsUser can, for example:


Decision Center API

© Copyright IBM Corp. 1987, 2013