public class IlrDefaultSessionController extends java.lang.Object implements IlrSessionController
IlrDefaultSessionController is the default session controller implementation used by Decision Center.
A session controller defines the interactive behavior of Decision Center. To keep the default behavior for customized session controller, create a subclass of
IBM Decision Center is a rule management server and repository integrated into a J2EE application server. It is used for authoring, managing, validating, and deploying business rules. Using this
API you Overview
IlrDefaultSessionController, then enhance only the features you want to change. Each method in your customized session controller class must call its super method whenever possible.
For more information, see the session controller example.
About Decision Center API
connect to Decision Center and create an IlrSession instance for a specific user. You use the API to do the
following:
IlrSession,
SessionListener,
IlrDefaultSearchCriteria| Modifier and Type | Field and Description |
|---|---|
protected java.util.List |
listeners
The list of session listeners registered on this controller.
|
protected IlrSession |
session
The session associated with this controller.
|
CHANGE_ACTIVITY_CONTROLLER_CALLBACK, CONTROLLER_CALLBACK, ISUSERINROLE_CALLBACK, RELEASE_CONTROLLER_CALLBACK, VALIDATION_ACTIVITY_CONTROLLER_CALLBACK| Constructor and Description |
|---|
IlrDefaultSessionController() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSessionListener(SessionListener l)
Adds a session listener to the session listeners list.
|
void |
checkCreate(IlrBaseline baseline,
org.eclipse.emf.ecore.EClass eclass)
Checks whether the current user has the right to create elements of the given class.
|
void |
checkDelete(IlrBranch branch,
IlrElementHandle element)
Checks to see if the current user has the right to delete a specific element in the given branch.
|
void |
checkDelete(IlrElementHandle element)
Checks to see if the current user has the right to delete a specific element.
|
void |
checkUpdate(IlrBaseline baseline,
IlrElementHandle element,
IlrElementDetails details,
org.eclipse.emf.ecore.EStructuralFeature feature)
Checks whether the current user has the right to update the given element in given branch.
|
void |
checkUpdate(IlrElementHandle element,
IlrElementDetails details,
org.eclipse.emf.ecore.EStructuralFeature feature)
Checks whether the current user has the right to update the given element.
|
void |
elementAddedToBaseline(IlrElementHandle element,
IlrBaseline baseline)
Implements a custom session controller that changes the way in which Decision
Center reacts to an action.
|
void |
elementCommitted(IlrBranch branch,
IlrCommitableObject cobject,
IlrElementHandle newHandle)
Calls the list of session listeners registered on this controller.
|
void |
elementCommitted(IlrCommitableObject cobject,
IlrElementHandle newHandle)
Calls the list of session listeners registered on this controller.
|
void |
elementDeleted(IlrBaseline baseline)
Calls the list of session listeners registered on this controller.
|
void |
elementDeleted(IlrBranch branch,
IlrElementHandle element)
Calls the list of session listeners registered on this controller.
|
void |
elementDeleted(IlrElementHandle element)
Calls the list of session listeners registered on this controller.
|
void |
elementDeleted(IlrProjectInfo prjInfo)
Calls the list of session listeners registered on this controller.
|
void |
elementRemovedFromBaseline(IlrElementHandle element,
IlrBaseline baseline)
Implements a custom session controller that changes the way in which Decision
Center reacts to an action.
|
java.lang.Object |
getInitialValue(IlrElementDetails element,
org.eclipse.emf.ecore.EStructuralFeature feature)
Gets the initial value for the given feature.
|
protected ilog.rules.commonbrm.model.IlrInitialValue |
getInitialValueCallback(org.eclipse.emf.ecore.EStructuralFeature feature)
Gets the initial value class defined in the Decision Center preferences for the given feature, if any.
|
IlrBusinessVersion |
getNextVersion(boolean isNew,
boolean isNewInBranch,
IlrBusinessVersion previousVersion)
Called By RTS when creating or updating an element to get the new version details.
|
java.util.List |
getPossibleValues(IlrElementHandle element,
org.eclipse.emf.ecore.EStructuralFeature feature)
Gets the possible values for the given feature.
|
protected ilog.rules.commonbrm.model.IlrPropertyExtension |
getPropertyExtension()
Gets the property extension class defined in the Decision Center preferences, if any.
|
boolean |
isEditable(IlrElementHandle element,
java.lang.String property)
Tests whether the given feature for a specific element is editable.
|
boolean |
isHidden(IlrElementHandle element,
java.lang.String property)
Tests whether the given feature for a specific element must be hidden.
|
boolean |
isServerVisible(IlrServer server,
IlrRuleApp ruleApp)
Called when the list of servers to deploy on is displayed.
|
boolean |
isServerVisible(IlrServer server,
IlrScenarioSuite suite)
This method is called when the list of servers that can be set on the test suite is displayed.
|
java.lang.String |
isValid(IlrElementHandle element,
java.lang.String feature,
java.lang.Object value)
Tests whether the given value for a specific feature and element is valid.
|
void |
onAddElementToBaseline(IlrElementHandle element,
IlrBaseline baseline)
Implements a custom session controller that changes the way in which Decision
Center reacts to an action.
|
void |
onCheckRulesetArchive(ilog.rules.archive.IlrRulesetArchive rulesetArchive,
IlrBaseline baseline,
IlrSearchCriteria ruleArtifactquery,
ilog.rules.commonbrm.extractor.IlrExtractorValidator extractorValidator,
java.util.List generationErrors)
This method does nothing in this default implementation.
|
void |
onCommitElement(IlrBranch branch,
IlrCommitableObject cobject)
Passes the element to the
onCommitElement method of the SessionListener attached to this session controller. |
void |
onCommitElement(IlrCommitableObject cobject)
Passes the element to the
onCommitElement method of the SessionListener attached to this session controller. |
void |
onDeleteElement(IlrBranch branch,
IlrElementHandle element)
Passes the element to the
onDeleteElement method of the SessionListener attached to this session controller. |
void |
onDeleteElement(IlrElementHandle element)
Passes the element to the
onDeleteElement method of the SessionListener attached to this session controller. |
void |
onGenerateRulesetArchive(ilog.rules.engine.IlrRulesetArchiveBuilder rulesetArchiveBuilder,
IlrBaseline baseline,
IlrSearchCriteria ruleArtifactquery,
ilog.rules.commonbrm.extractor.IlrExtractorValidator extractorValidator)
This method does nothing in this default implementation.
|
void |
onRemoveElementFromBaseline(IlrElementHandle element,
IlrBaseline baseline)
Implements a custom session controller that changes the way in which Decision
Center reacts to an action.
|
IlrSearchCriteria |
redefineSearch(IlrSearchCriteria searchCriteria)
Called each time a search is performed using search criteria.
|
void |
removeSessionListener(SessionListener l)
Removes a session listener from the session listeners list.
|
void |
securityProfileCommitted(java.lang.String role,
IlrSecurityProfileData profile)
Called when new permissions for a given
role have been committed. |
void |
securityProfileDeleted(java.lang.String role)
Called when permissions for a given
role have been deleted. |
void |
setSession(IlrSession dataProvider)
Sets the session for this callback.
|
protected IlrSession session
protected java.util.List listeners
public void setSession(IlrSession dataProvider)
IlrSessionCallbackThis method is called just after a user connects to a session.
setSession in interface IlrSessionCallbackdataProvider - The session.IlrSessionFactory.connect(String, String, String, String),
Overviewpublic void checkUpdate(IlrElementHandle element, IlrElementDetails details, org.eclipse.emf.ecore.EStructuralFeature feature) throws IlrPermissionException, IlrObjectNotFoundException
IlrSessionControllerDecision Center calls this method in several places. It is called by the Decision Center GUI front end to check if:
commit method to check if
the details of an edited object can be committed.checkUpdate in interface IlrSessionControllerIlrPermissionException - if the current user does not have the
rights to change element.IlrObjectNotFoundException - if feature is not found in
the Decision Center database.element - The element handle. This parameter may be set to
null.details - The object that will be committed if this method does not
throw any exceptions. This parameter may be set to null.feature - The feature to modify. If set to null,
you should consider whether the entire object can be modified in your
custom session controller.public void checkUpdate(IlrBaseline baseline, IlrElementHandle element, IlrElementDetails details, org.eclipse.emf.ecore.EStructuralFeature feature) throws IlrPermissionException, IlrObjectNotFoundException
IlrSessionControllerDecision Center calls this method in several places. It is called by the Decision Center GUI front end to check if:
commit method to check if
the details of an edited object can be committed.checkUpdate in interface IlrSessionControllerIlrPermissionException - if the current user does not have the
rights to change element.IlrObjectNotFoundException - if feature is not found in
the Decision Center database.element - The element handle. This parameter may be set to
null.details - The object that will be committed if this method does not
throw any exceptions. This parameter may be set to null.feature - The feature to modify. If set to null,
you should consider whether the entire object can be modified in your
custom session controller.public void checkDelete(IlrElementHandle element) throws IlrPermissionException, IlrObjectNotFoundException
checkDelete in interface IlrSessionControllerIlrPermissionException - if the current user does not have the right to delete element.IlrObjectNotFoundException - if element cannot be found in the Decision Center database.element - The element handle.public void checkDelete(IlrBranch branch, IlrElementHandle element) throws IlrPermissionException, IlrObjectNotFoundException
checkDelete in interface IlrSessionControllerIlrPermissionException - if the current user does not have the right to delete element.IlrObjectNotFoundException - if element cannot be found in the Decision Center database.branch - The branch in which the permission should be checked.element - The element handle.public void checkCreate(IlrBaseline baseline, org.eclipse.emf.ecore.EClass eclass) throws IlrPermissionException, IlrObjectNotFoundException
Implements a custom session controller to change the way Decision Center reacts to this action.
checkCreate in interface IlrSessionControllerIlrPermissionException - If the current user does not have the right to create eclassIlrObjectNotFoundException - If element cannot be found in the Decision Center database.eclass - The element class.baseline - The branch on which the check should be done. If this argument is null, the working baseline is checked.public boolean isHidden(IlrElementHandle element, java.lang.String property) throws IlrObjectNotFoundException
IlrSessionController
This method is used in the UI to test if the current user has
the rights to see the feature.
isHidden in interface IlrSessionControllerIlrObjectNotFoundException - If element is not found in
the database.element - The element handle.property - The feature to test.True if feature is hidden.public boolean isEditable(IlrElementHandle element, java.lang.String property) throws IlrObjectNotFoundException
IlrSessionController
This method is used in the UI to check if feature
may be edited by the current user.
isEditable in interface IlrSessionControllerIlrObjectNotFoundException - If an object is not found in the database.element - The element handle.property - The feature to test.True if feature is editable.public void onCheckRulesetArchive(ilog.rules.archive.IlrRulesetArchive rulesetArchive,
IlrBaseline baseline,
IlrSearchCriteria ruleArtifactquery,
ilog.rules.commonbrm.extractor.IlrExtractorValidator extractorValidator,
java.util.List generationErrors)
Implements a custom session controller to change the way Decision Center reacts to this action.
onCheckRulesetArchive in interface IlrSessionControllerrulesetArchive - The ruleset archive that has been generated.baseline - The baseline from which the execution artifacts were extracted.ruleArtifactquery - The query used to get the rule artifacts to be extracted. This parameter can be set to null.extractorValidator - The extractor validator used to filter out the artifacts to be extracted.generationErrors - A list of IlrElementError.IlrElementError,
IlrDeploymentFacility.generateRulesetArchive(IlrSearchCriteria, String, String),
Session Controllerspublic IlrSearchCriteria redefineSearch(IlrSearchCriteria searchCriteria)
IlrSessionControllerA typical use is to modify the search according to the role of the user. For example, you could redefine a search such that the current user can only view the rules with the status 'new'. In this case, you will return a new search criterion that will add (status, 'new') to the list of features and values of the input search criteria.
Note: Do not modify and return searchCriteria.
You must do one of the following:
searchCriteria unchangedIlrSearchCriteria instance with extra
criteria
redefineSearch in interface IlrSessionControllersearchCriteria - The search criteria passed when one of the
IlrSession.findElements methods is called.IlrSearchCriteria instance with
overridden criteria, or searchCriteria.public void onDeleteElement(IlrElementHandle element) throws IlrApplicationException
onDeleteElement method of the SessionListener attached to this session controller.
onDeleteElement in interface IlrSessionControllerIlrApplicationExceptionelement - The object to be deleted.addSessionListener(SessionListener),
IlrSession.deleteElement(IlrElementHandle),
Session Controllerspublic void onDeleteElement(IlrBranch branch, IlrElementHandle element) throws IlrApplicationException
onDeleteElement method of the SessionListener attached to this session controller.
onDeleteElement in interface IlrSessionControllerIlrApplicationExceptionelement - The object to be deleted.addSessionListener(SessionListener),
IlrSession.deleteElement(IlrElementHandle),
Session Controllerspublic void onCommitElement(IlrCommitableObject cobject) throws IlrApplicationException
onCommitElement method of the SessionListener attached to this session controller.
onCommitElement in interface IlrSessionControllerIlrApplicationExceptionIlrObjectNotFoundException - if cobject is not found in
the database.IlrPermissionException - if the current user does not have the
rights to commit cobject.IlrInvalidElementException - if cobject is invalid.
For example, if the name of a project element is null.IlrActivityObjectLockedExceptioncobject - The object to be committed.addSessionListener(SessionListener),
IlrSession.commit(IlrCommitableObject),
Session Controllerspublic void onCommitElement(IlrBranch branch, IlrCommitableObject cobject) throws IlrApplicationException
onCommitElement method of the SessionListener attached to this session controller.
onCommitElement in interface IlrSessionControllerIlrApplicationExceptionIlrObjectNotFoundException - if cobject is not found in
the database.IlrPermissionException - if the current user does not have the
rights to commit cobject.IlrInvalidElementException - if cobject is invalid.
For example, if the name of a project element is null.IlrActivityObjectLockedExceptioncobject - The object to be committed.branch - The branch in which the element should get committed.addSessionListener(SessionListener),
IlrSession.commit(IlrCommitableObject),
Session Controllerspublic void onGenerateRulesetArchive(ilog.rules.engine.IlrRulesetArchiveBuilder rulesetArchiveBuilder,
IlrBaseline baseline,
IlrSearchCriteria ruleArtifactquery,
ilog.rules.commonbrm.extractor.IlrExtractorValidator extractorValidator)
Implements a custom session controller to change the way in which Decision Center reacts to this action.
onGenerateRulesetArchive in interface IlrSessionControllerrulesetArchiveBuilder - The ruleset archive builder, ready to generate a ruleset archive. It contains the execution artifacts resulting from the extraction of the ruleset being generated.baseline - The baseline from which the execution artifacts were extracted.ruleArtifactquery - The query used to get the rule artifacts to be extracted. This parameter can be set to null.extractorValidator - The extractor validator used to filter out the artifacts to be extracted.IlrDeploymentFacility.generateRulesetArchive(IlrSearchCriteria, String, String),
Session Controllerspublic java.lang.String isValid(IlrElementHandle element, java.lang.String feature, java.lang.Object value) throws IlrObjectNotFoundException
IlrSessionController
This method is used in the UI to check if value
can be entered by the current user.
isValid in interface IlrSessionControllerIlrObjectNotFoundException - If an object is not found in the database.element - The element handle.feature - The feature to test.null otherwise.public java.util.List getPossibleValues(IlrElementHandle element, org.eclipse.emf.ecore.EStructuralFeature feature) throws IlrObjectNotFoundException
IlrSessionControllerOptionally, the element for which the framework wants the possible values can be given. This allows implementors to dynamically compute the possible values according to the current state of the element.
getPossibleValues in interface IlrSessionControllerIlrObjectNotFoundException - if feature is not found in
the Decision Center database.element - The element handle. This parameter may be set to
null.feature - The feature whose possible values you want to retrieve.
This must be an attribute whose type is enumerated (EEnum).null. Set your custom implementation to return
List.EMPTY_LIST if there are no possible values to return.public java.lang.Object getInitialValue(IlrElementDetails element, org.eclipse.emf.ecore.EStructuralFeature feature) throws IlrObjectNotFoundException
IlrSessionControllergetInitialValue in interface IlrSessionControllerIlrObjectNotFoundException - if feature is not found in
the Decision Center database.element - The element handle. This parameter may be set to null.feature - The feature whose initial value is to be returned.null.public void elementCommitted(IlrCommitableObject cobject, IlrElementHandle newHandle) throws IlrApplicationException
elementCommitted in interface IlrSessionControllerIlrApplicationExceptionIlrObjectNotFoundException - if object is not found in the database.cobject - The committed object.newHandle - The new handle.IlrSession.commit(IlrCommitableObject),
Overviewpublic void elementCommitted(IlrBranch branch, IlrCommitableObject cobject, IlrElementHandle newHandle) throws IlrApplicationException
elementCommitted in interface IlrSessionControllerIlrApplicationExceptionIlrObjectNotFoundException - if object is not found in the database.cobject - The committed object.IlrSession.commit(IlrCommitableObject),
Overviewpublic void elementDeleted(IlrElementHandle element) throws IlrObjectNotFoundException
elementDeleted in interface IlrSessionControllerIlrObjectNotFoundException - if element is not found in
the database.element - The deleted object.IlrSession.deleteElement(IlrElementHandle),
Overviewpublic void elementDeleted(IlrBranch branch, IlrElementHandle element) throws IlrObjectNotFoundException
elementDeleted in interface IlrSessionControllerIlrObjectNotFoundException - if element is not found in
the database.element - The deleted object.IlrSession.deleteElement(IlrElementHandle),
Overviewpublic void elementDeleted(IlrBaseline baseline) throws IlrObjectNotFoundException
elementDeleted in interface IlrSessionControllerIlrObjectNotFoundException - if baseline is not found
in the database.baseline - The deleted baseline.IlrSession.deleteElement(IlrElementHandle),
Overviewpublic void elementDeleted(IlrProjectInfo prjInfo) throws IlrObjectNotFoundException
elementDeleted in interface IlrSessionControllerIlrObjectNotFoundException - if prjInfo is not found
in the database.prjInfo - The deleted project info.IlrSession.deleteElement(IlrElementHandle),
Overviewpublic void addSessionListener(SessionListener l)
l - The session listener.public void removeSessionListener(SessionListener l)
l - The session listener.public void elementAddedToBaseline(IlrElementHandle element, IlrBaseline baseline) throws IlrApplicationException
IlrSessionControllerelementAddedToBaseline in interface IlrSessionControllerIlrApplicationException - if element cannot be added to
baseline.element - The element to add.baseline - The baseline to update.IlrBaselineManagementFacility.addToBaseline(IlrElementHandle, IlrBaseline),
Overviewpublic void elementRemovedFromBaseline(IlrElementHandle element, IlrBaseline baseline) throws IlrApplicationException
IlrSessionControllerelementRemovedFromBaseline in interface IlrSessionControllerIlrApplicationException - if element cannot be removed from
baseline.element - The element that has been removed.baseline - The baseline to update.IlrBaselineManagementFacility.addToBaseline(IlrElementHandle, IlrBaseline),
Overviewpublic void onAddElementToBaseline(IlrElementHandle element, IlrBaseline baseline) throws IlrApplicationException
IlrSessionControllerIlrSession.addToBaseline
method, just before the element is added to a baseline.onAddElementToBaseline in interface IlrSessionControllerIlrApplicationException - if element cannot be added to
baseline.element - The element to be added.baseline - The baseline to be updated.IlrBaselineManagementFacility.addToBaseline(IlrElementHandle, IlrBaseline),
Overviewpublic void onRemoveElementFromBaseline(IlrElementHandle element, IlrBaseline baseline) throws IlrApplicationException
IlrSessionControllerIlrSession.removeFromBaseline
method, just before the element is removed from a baseline.onRemoveElementFromBaseline in interface IlrSessionControllerIlrApplicationException - if element cannot be removed from
baseline.element - The element to be removed.baseline - The baseline to be updated.IlrBaselineManagementFacility.addToBaseline(IlrElementHandle, IlrBaseline),
Overviewprotected ilog.rules.commonbrm.model.IlrPropertyExtension getPropertyExtension()
IlrPropertyExtension, or null if no property extension has been defined.protected ilog.rules.commonbrm.model.IlrInitialValue getInitialValueCallback(org.eclipse.emf.ecore.EStructuralFeature feature)
IlrInitialValue, or null if no initial value class has been defined.public boolean isServerVisible(IlrServer server, IlrRuleApp ruleApp)
IlrSessionControllerImplements a custom session controller to filter the displayed servers.
isServerVisible in interface IlrSessionControllerserver - The server to manage.ruleApp - The RuleApp to deploy.public boolean isServerVisible(IlrServer server, IlrScenarioSuite suite)
IlrSessionControllerImplements a custom session controller to filter the displayed servers.
isServerVisible in interface IlrSessionControllerserver - The server to manage.suite - The test suite.public void securityProfileCommitted(java.lang.String role,
IlrSecurityProfileData profile)
IlrSessionControllerrole have been committed.securityProfileCommitted in interface IlrSessionControllerrole - The role on which the permissions have changed.profile - The permissions that have been committed.public void securityProfileDeleted(java.lang.String role)
IlrSessionControllerrole have been deleted.securityProfileDeleted in interface IlrSessionControllerrole - The role on which the permissions have been deleted.public IlrBusinessVersion getNextVersion(boolean isNew, boolean isNewInBranch, IlrBusinessVersion previousVersion)
IlrSessionControllergetNextVersion in interface IlrSessionControllerisNew - true if this is a new element to createisNewInBranch - true if the element is updated for the first time in working branchpreviousVersion - latest element version in working branch hierarchy, null if this is a new element© Copyright IBM Corp. 1987, 2017