|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.teamserver.model.IlrDefaultSessionController
public class IlrDefaultSessionController
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
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.
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 connect
to Decision Center and create an IlrSession
instance for a specific user. You use the API to do the
following:
IlrSession
,
SessionListener
,
IlrDefaultSearchCriteria
Field Summary | |
---|---|
protected List |
listeners
The list of session listeners registered on this controller. |
protected IlrSession |
session
The session associated with this controller. |
Fields inherited from interface ilog.rules.teamserver.model.IlrSessionCallback |
---|
CHANGE_ACTIVITY_CONTROLLER_CALLBACK, CONTROLLER_CALLBACK, ISUSERINROLE_CALLBACK, RELEASE_CONTROLLER_CALLBACK, VALIDATION_ACTIVITY_CONTROLLER_CALLBACK |
Constructor Summary | |
---|---|
IlrDefaultSessionController()
|
Method Summary | |
---|---|
void |
addSessionListener(SessionListener l)
Adds a session listener to the session listeners list. |
void |
checkCreate(org.eclipse.emf.ecore.EClass eclass)
Checks whether the current user has the right to create elements of the given class. |
void |
checkDelete(IlrElementHandle element)
Checks to see if the current user has the right to delete a specific element. |
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(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(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. |
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. |
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,
String property)
Tests whether the given feature for a specific element is editable. |
boolean |
isHidden(IlrElementHandle element,
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. |
String |
isValid(IlrElementHandle element,
String feature,
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,
List generationErrors)
This method does nothing in this default implementation. |
void |
onCommitElement(IlrCommitableObject cobject)
Passes the element to the onCommitElement 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(String role,
IlrSecurityProfileData profile)
Called when new permissions for a given role have been committed. |
void |
securityProfileDeleted(String role)
Called when permissions for a given role have been deleted. |
void |
setSession(IlrSession dataProvider)
Sets the session for this callback. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IlrSession session
protected List listeners
Constructor Detail |
---|
public IlrDefaultSessionController()
Method Detail |
---|
public void setSession(IlrSession dataProvider)
IlrSessionCallback
This method is called just after a user connects to a session.
setSession
in interface IlrSessionCallback
dataProvider
- The session.IlrSessionFactory.connect(String, String, String, String)
,
Overviewpublic void checkUpdate(IlrElementHandle element, IlrElementDetails details, org.eclipse.emf.ecore.EStructuralFeature feature) throws IlrPermissionException, IlrObjectNotFoundException
IlrSessionController
Decision 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 IlrSessionController
IlrPermissionException
- 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 IlrSessionController
IlrPermissionException
- 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 checkCreate(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 IlrSessionController
IlrPermissionException
- If the current user does not have the right to create eclass
IlrObjectNotFoundException
- If element
cannot be found in the Decision Center database.eclass
- The element class.public boolean isHidden(IlrElementHandle element, 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 IlrSessionController
IlrObjectNotFoundException
- 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, 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 IlrSessionController
IlrObjectNotFoundException
- 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, List generationErrors)
Implements a custom session controller to change the way Decision Center reacts to this action.
onCheckRulesetArchive
in interface IlrSessionController
rulesetArchive
- 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)
IlrSessionController
A 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 IlrSessionController
searchCriteria
- 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 IlrSessionController
IlrApplicationException
element
- 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 IlrSessionController
IlrApplicationException
IlrObjectNotFoundException
- 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
.
IlrActivityObjectLockedException
cobject
- The object to be 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 IlrSessionController
rulesetArchiveBuilder
- 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 String isValid(IlrElementHandle element, String feature, 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 IlrSessionController
IlrObjectNotFoundException
- If an object is not found in the database.element
- The element handle.feature
- The feature to test.
null
otherwise.public List getPossibleValues(IlrElementHandle element, org.eclipse.emf.ecore.EStructuralFeature feature) throws IlrObjectNotFoundException
IlrSessionController
Optionally, 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 IlrSessionController
IlrObjectNotFoundException
- 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 Object getInitialValue(IlrElementDetails element, org.eclipse.emf.ecore.EStructuralFeature feature) throws IlrObjectNotFoundException
IlrSessionController
getInitialValue
in interface IlrSessionController
IlrObjectNotFoundException
- 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 IlrSessionController
IlrApplicationException
IlrObjectNotFoundException
- 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 IlrSessionController
IlrObjectNotFoundException
- 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 IlrSessionController
IlrObjectNotFoundException
- 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 IlrSessionController
IlrObjectNotFoundException
- 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
IlrSessionController
elementAddedToBaseline
in interface IlrSessionController
IlrApplicationException
- 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
IlrSessionController
elementRemovedFromBaseline
in interface IlrSessionController
IlrApplicationException
- 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
IlrSessionController
IlrSession.addToBaseline
method, just before the element is added to a baseline.
onAddElementToBaseline
in interface IlrSessionController
IlrApplicationException
- 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
IlrSessionController
IlrSession.removeFromBaseline
method, just before the element is removed from a baseline.
onRemoveElementFromBaseline
in interface IlrSessionController
IlrApplicationException
- 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)
IlrSessionController
Implements a custom session controller to filter the displayed servers.
isServerVisible
in interface IlrSessionController
server
- The server to manage.ruleApp
- The RuleApp to deploy.
public boolean isServerVisible(IlrServer server, IlrScenarioSuite suite)
IlrSessionController
Implements a custom session controller to filter the displayed servers.
isServerVisible
in interface IlrSessionController
server
- The server to manage.suite
- The test suite.
public void securityProfileCommitted(String role, IlrSecurityProfileData profile)
IlrSessionController
role
have been committed.
securityProfileCommitted
in interface IlrSessionController
role
- The role on which the permissions have changed.profile
- The permissions that have been committed.public void securityProfileDeleted(String role)
IlrSessionController
role
have been deleted.
securityProfileDeleted
in interface IlrSessionController
role
- The role on which the permissions have been deleted.public IlrBusinessVersion getNextVersion(boolean isNew, boolean isNewInBranch, IlrBusinessVersion previousVersion)
IlrSessionController
getNextVersion
in interface IlrSessionController
isNew
- 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
|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |