|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IlrSession
Allows you to connect a registered user to Decision Center. The user can then read data from or write data to the server.
All session objects are stateful, that is, they are always
associated with the user whose credentials were given when
connect
was called. See Project
Security for more information. Use an
IlrSessionFactory
instance to connect
to Decision Center and return an
IlrSession
instance.
The following code example shows how to connect to the Decision Center and run a query on the server from a client Java application:
String serverUrl = "http://localhost:9080/teamserver"; String datasource = "jdbc/ilogDataSource"; String login = "rtsAdmin"; String password = "rtsAdmin"; String project = "loanvalidation-rules"; IlrSessionFactory factory = new IlrRemoteSessionFactory(); try { factory.connect(login, password, serverUrl, datasource); IlrSession session = factory.getSession(); // get the project by name IlrRuleProject ruleProject = (IlrRuleProject) IlrSessionHelper.getProjectNamed(session, project); // open current baseline IlrBaseline currentBaseline = IlrSessionHelper.getCurrentBaseline(session, ruleProject); session.setWorkingBaseline(currentBaseline); String query = new String("Find all business rules such that " + "the last modification date of each " + "business rule is after 10/27/05 2:55:25 PM"); IlrDefaultSearchCriteria criteria = new IlrDefaultSearchCriteria( query.toString()); List summaries = session.findElements(criteria, IlrModelConstants.ELEMENT_SUMMARY); for (int i = 0; i < summaries.size(); i++) { IlrElementSummary ruleSummary = (IlrElementSummary) summaries.get(i); String ruleName = ruleSummary.getName(); System.out.println("\t" + ruleName); } session.close(); } catch (IlrConnectException cE) { cE.printStackTrace(); }
IlrSessionHelper
,
IlrSessionFactory
,
IlrSessionController
,
IlrExtractorValidator
,
IlrSearchCriteria
Field Summary |
---|
Fields inherited from interface ilog.rules.teamserver.model.IlrDeploymentFacility |
---|
DEPLOY, INC_MAJOR, INC_MAJOR_RULESET, INC_MINOR, INC_MINOR_RULESET, REDEPLOY, REPLACE_RULEAPP, REPLACE_RULESET |
Fields inherited from interface ilog.rules.teamserver.model.IlrModelConstants |
---|
CURRENT_BASELINE_NAME, DEFAULT_EXTRACTORVALIDATOR, DEFAULT_SCOPE, DEFAULT_SSPRESOLVER, ELEMENT_COMMITABLE_OBJECT, ELEMENT_DETAILS, ELEMENT_HANDLE, ELEMENT_SUMMARY, RECYCLEBIN_BASELINE, SCOPE_PROJECT, SCOPE_PROJECT_AND_DEPENDENCIES |
Method Summary | |
---|---|
void |
beginUsage()
Begin the work on this session. |
void |
close()
Closes the session. |
IlrElementHandle |
commit(IlrCommitableObject cobject)
Commits the given committable object with all its attached elements, to Decision Center. |
IlrElementHandle |
commit(IlrElementDetails details)
Commits the given element details. |
List<IlrElementHandle> |
commit(List commitableObjects)
Commits the given list of committable objects. |
IlrElementHandle |
copyTo(IlrElementHandle sourceElement,
IlrElementVersion elementVersion,
IlrElementDetails target,
boolean recursive,
String duplicatePrefix)
Copies an element or one of its versions in a package. |
IlrElementHandle |
copyTo(IlrElementHandle sourceElement,
IlrElementVersion elementVersion,
IlrElementDetails target,
IlrBaseline branch,
boolean recursive,
String duplicatePrefix)
Copies an element or one of its versions in a package. |
List |
copyTo(List sourceElements,
IlrElementDetails target,
boolean recursive,
String duplicatePrefix)
Copies a list of elements in a package. |
List |
copyTo(List sourceElements,
IlrElementDetails target,
IlrBaseline branch,
boolean recursive,
String duplicatePrefix)
Copies a list of elements in a package. |
IlrElementHandle |
createElement(org.eclipse.emf.ecore.EClass eclass)
Creates a handle for the given EMF class. |
void |
deleteElement(IlrElementHandle element)
Deletes the given element from the working project. |
void |
deleteElement(IlrElementHandle element,
boolean recursive)
Deletes the given element from the working project recursively on request. |
void |
deleteElements(List<? extends IlrElementHandle> elements)
Deletes the given list of elements from the working project. |
void |
deleteElements(List<? extends IlrElementHandle> elements,
boolean recursive)
Deletes the given list of elements from the working project recursively, if requested. |
String |
elementHandleToString(IlrElementHandle element)
Returns a string serialization of the given element. |
void |
endUsage()
End the work on this session. |
void |
eraseProject(IlrRuleProject ruleProject)
Erases a project from the database. |
int |
executeQuery(IlrSearchCriteria searchCriteria)
Finds the elements matching the given search criteria and executes the action defined in the query. |
List<IlrCommitableObject> |
findElementCommitableObjects(IlrSearchCriteria searchCriteria)
Same function as List findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat) , returning IlrCommitableObject elements. |
List<IlrElementDetails> |
findElementDetails(IlrSearchCriteria searchCriteria)
Same function as List findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat) , returning IlrElementDetails elements. |
List<IlrElementHandle> |
findElementHandles(IlrSearchCriteria searchCriteria)
Same function as List findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat) , returning IlrElementHandle elements. |
List |
findElements(IlrSearchCriteria searchCriteria)
Returns the list of elements matching the given search criteria. |
List |
findElements(IlrSearchCriteria searchCriteria,
int returnedObjectFormat)
Returns the elements stored in Decision Center that match the given search criteria. |
List<IlrBaseline> |
getAccessibleBaselines(IlrElementHandle ruleProjectHandle)
Returns the baselines for given rule project that can be accessed by the current user for this session. |
List<IlrBaseline> |
getAccessibleChildrenBaselines(IlrBaseline parentBaseline)
Returns the baselines that are children of the one given as a parameter and that can be accessed by the current user for this session. |
List<IlrRuleProject> |
getAccessibleProjects()
Returns the projects that can be accessed by the current user for this session. |
Object |
getAttribute(String name)
Returns the object bound with the specified name in this session. |
Iterator<String> |
getAttributeNames()
Returns an Iterator of String objects containing the names of all the objects bound to this session. |
IlrBrmPackage |
getBrmPackage()
Gets the EMF package containing the Decision Center classes and data types. |
IlrElementDetails |
getElementDetails(IlrElementHandle handle)
Returns the details for the element in Decision Center that corresponds to the given handle. |
IlrElementDetails |
getElementDetails(IlrElementHandle handle,
IlrElementVersion version)
Returns the details of the given element for the given version of the element. |
IlrElementDetails |
getElementDetailsForThisHandle(IlrElementHandle handle)
Returns the details that correspond to the exact version of the given element handle. |
IlrElementDetails |
getElementDetailsInWorkingBaseline(IlrElementHandle handle)
Returns the details of the given element in the working baseline. |
List |
getElementsFromReference(IlrElementHandle handle,
org.eclipse.emf.ecore.EReference reference,
IlrElementVersion version,
int returnedObjectFormat)
Returns the value of the given reference for the given version of the given element. |
List |
getElementsFromReference(IlrElementHandle handle,
org.eclipse.emf.ecore.EReference reference,
int returnedObjectFormat)
Returns the value of the reference for the given element. |
List |
getElementsFromReference(IlrElementHandle handle,
org.eclipse.emf.ecore.EReference reference,
int returnedObjectFormat,
org.eclipse.emf.ecore.EStructuralFeature orderBy)
Returns the value of the reference for the given element. |
IlrElementSummary |
getElementSummary(IlrElementHandle handle)
Returns the summary for the given element handle. |
IlrElementSummary |
getElementSummary(IlrElementHandle handle,
IlrElementVersion version)
Returns the summary of the given element for the given version of the element. |
IlrElementSummary |
getElementSummaryForThisHandle(IlrElementHandle handle)
Returns the summary that correspond to the exact version of the given element handle. |
IlrElementVersion |
getElementVersion(IlrElementHandle element)
Returns the version information corresponding to the given element. |
IlrElementVersion |
getElementVersion(IlrElementHandle element,
IlrElementHandle baseline)
Returns the version of the given element that is referenced by the given baseline. |
List<IlrElementVersion> |
getElementVersions(IlrElementHandle element)
Returns a list containing all versions of a given element stored in Decision Center. |
String[] |
getHierarchyPath(IlrElementHandle handle)
Returns the hierarchy path of a rule package, that is, a folder. |
Date |
getLoginDate()
Returns the date the user connected with this session logged into Decision Center. |
IlrModelInfo |
getModelInfo()
Returns the model info object describing the business rule model of Decision Center. |
List |
getPossibleValues(IlrElementHandle element,
org.eclipse.emf.ecore.EStructuralFeature feature)
Returns the possible values for the given element and feature. |
Locale |
getReferenceLocale()
Returns the reference locale. |
Locale |
getUserLocale()
Returns The locale for the current user. |
String |
getUserName()
Returns the name of the user connected with this session. |
IlrBaseline |
getWorkingBaseline()
Returns the working baseline. |
ilog.rules.bom.IlrObjectModel |
getWorkingBOM()
Returns the Business Object Model (BOM) for the current baseline. |
ilog.rules.brl.brldf.IlrBRLVariableProvider |
getWorkingVariableProvider()
Returns the variable provider for the working baseline. |
ilog.rules.vocabulary.model.IlrVocabularyManager |
getWorkingVocabulary()
Returns the vocabulary manager for the working baseline. |
boolean |
isUserInRole(String role)
Indicates whether the user has the given role. |
boolean |
reloadDynamicDomains()
Reloads all the dynamic domains present in the BOM. |
Object |
removeAttribute(String name)
Removes the object bound with the specified name from this session. |
void |
restoreVersion(IlrElementHandle element,
IlrElementVersion elementVersion)
Restores the given version of the given element. |
void |
setAttribute(String name,
Object value)
Binds an object to this session, using the name specified. |
void |
setUserLocale(Locale locale)
Sets the locale for the current user. |
void |
setWorkingBaseline(IlrBaseline baseline)
Sets the working baseline for this session. |
IlrElementHandle |
stringToElementHandle(String idString)
Returns the element handle corresponding to the given string. |
Methods inherited from interface ilog.rules.teamserver.model.IlrLockingFacility |
---|
checkIsElementBusy, clearAllLocks, clearNonPersistentLocks, getLockOwner, getRootLockedElementForElement, isElementBusy, isPersistentLock, lockBranches, lockElement, lockElement, lockElements, ownsLock, releaseElementLock, releaseElementLocks, releaseNonPersistentLocks, unlockBranches, unlockElement, unlockElements |
Methods inherited from interface ilog.rules.teamserver.model.ActivityLockingFacility |
---|
eltNameLockVisible, getActivityLockOwner, isActivityElementBusy, lockActivityElement, ownsActivityLock, releaseActivityLock, unlockActivityElements |
Methods inherited from interface ilog.rules.teamserver.model.permissions.IlrPermissionsFacility |
---|
checkPermissionCreate, checkPermissionDelete, checkPermissionUpdate, checkPermissionView, commitSecurityProfileData, eraseSecurityProfile, getAvailableGroups, getPermissionableClasses, getSecurityProfileData, isEditable, isHidden, setAvailableGroups |
Methods inherited from interface ilog.rules.teamserver.model.IlrDeploymentFacility |
---|
deployEventProject, deployRuleAppArchive, generateRuleAppArchive, generateRulesetArchive |
Methods inherited from interface ilog.rules.teamserver.model.IlrTestingFacility |
---|
executeScenarioSuite, generateScenarioSuiteArchive |
Method Detail |
---|
void beginUsage()
IlrSession
object is bound to the current thread.
If this method is not called, you will not be able to use objects returned by the IlrSession
(for example IlrElementHandle.getValue(EStructuralFeature)
with throw an IllegalStateException if beginUsage
has not been called).
the following idiom should be used:
IlrSession session = factory.getSession();
try {
session.beginUsage();
// do some work
...
} finally {
session.endUsage();
}
void endUsage()
IlrSession
object is unbound to the current thread.
If this method is not called the IlrSession
object will stay attached to the current thread and can be the cause of a memory leak in an application server context.
List findElements(IlrSearchCriteria searchCriteria) throws IlrObjectNotFoundException, IlrRoleRestrictedPermissionException
Calling this method is equivalent to calling
findElements(IlrSearchCriteria, IlrModelConstants.ELEMENT_DETAILS)
.
IlrObjectNotFoundException
- if some elements required to perform the
search are missing. For example, the working baseline, or the project to be
searched in the working baseline.
IlrRoleRestrictedPermissionException
- if the working baseline is
null
and project elements are found when the current user is not
an administrator.searchCriteria
- The search criteria.
IlrElementDetails
.findElements(IlrSearchCriteria, int)
List findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat) throws IlrObjectNotFoundException, IlrRoleRestrictedPermissionException
If the working baseline is not null
, the search is done
using the working baseline. This method automatically takes into account the view permissions of the current user.
For example, if the user does not have the rights to view decision tables and searches for all
rules contained in the project, only rules that are not in decision tables are returned.
IlrObjectNotFoundException
- if some elements required to perform the
search are missing. For example, the working baseline, or the project to be
searched in the working baseline.
IlrRoleRestrictedPermissionException
- if the working baseline is
null
and project elements are found when the current user is not
an administrator.searchCriteria
- The search criteria.returnedObjectFormat
- Set the format of the returned objects to one
of the following:
IlrModelConstants.ELEMENT_HANDLE
IlrModelConstants.ELEMENT_SUMMARY
IlrModelConstants.ELEMENT_DETAILS
returnedObjectFormat
. The listed objects will be one of the
following types:
IlrElementHandle
IlrElementSummary
IlrElementDetails
List<IlrCommitableObject> findElementCommitableObjects(IlrSearchCriteria searchCriteria) throws IlrObjectNotFoundException, IlrRoleRestrictedPermissionException
List findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat)
, returning IlrCommitableObject elements.
IlrObjectNotFoundException
IlrRoleRestrictedPermissionException
searchCriteria
-
List<IlrElementDetails> findElementDetails(IlrSearchCriteria searchCriteria) throws IlrObjectNotFoundException, IlrRoleRestrictedPermissionException
List findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat)
, returning IlrElementDetails elements.
IlrObjectNotFoundException
IlrRoleRestrictedPermissionException
searchCriteria
-
List<IlrElementHandle> findElementHandles(IlrSearchCriteria searchCriteria) throws IlrObjectNotFoundException, IlrRoleRestrictedPermissionException
List findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat)
, returning IlrElementHandle elements.
IlrObjectNotFoundException
IlrRoleRestrictedPermissionException
searchCriteria
-
int executeQuery(IlrSearchCriteria searchCriteria) throws IlrApplicationException
The Do part of the following
query
is an example of a search on an action part of a rule:
Find all business rules such that ... Do set the status of 'each business rule' to newWhen the query is run, the action part is executed for each element found by the search criteria. If there is a failure when applying the actions, an exception is thrown and the whole transaction is rolled back such that no changes are made to any element.
IlrApplicationException
- if an error occurs during the query
execution. In this case, any change that could have been made to the elements before the
exception was thrown are rolled back. and the remaining actions are canceled.searchCriteria
- The search criteria.
List getPossibleValues(IlrElementHandle element, org.eclipse.emf.ecore.EStructuralFeature feature) throws IlrObjectNotFoundException
This method is typically called inside a GUI in order to display the
items of an enumerated feature.
It calls the IlrSessionController.getPossibleValues(ilog.rules.teamserver.model.IlrElementHandle, org.eclipse.emf.ecore.EStructuralFeature)
method, which
by default lists the items of the EEnum
type of the feature.
IlrObjectNotFoundException
- if element
cannot be found.element
- The current element.feature
- The enumerated feature. This parameter must be an
EEnum
instance.
feature
.IlrElementDetails getElementDetails(IlrElementHandle handle) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- if handle
cannot be found
in the database.handle
- The handle on the element whose details are needed.
handle
according to the
following cases:
handle
is a
project element
,
the IlrElementDetails
instance returned correspond to the version of
the element referenced in the
working baseline
.handle
is not a project element, the
IlrElementDetails
instance returned correspond to the
exact version
of handle
.IlrElementSummary getElementSummary(IlrElementHandle handle) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- if handle
cannot be found
in the database.handle
- Handle on the element.
IlrElementSummary getElementSummaryForThisHandle(IlrElementHandle handle) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- if handle
cannot be found
in the database.handle
- Handle on the element.
List getElementsFromReference(IlrElementHandle handle, org.eclipse.emf.ecore.EReference reference, int returnedObjectFormat) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- if the given element cannot be found
in the database, or if some of the returned values cannot be found before
the end of the transaction.handle
- The element handle.reference
- The EMF reference.returnedObjectFormat
- The format of the objects to be returned.
This can be one of the following:
IlrModelConstants.ELEMENT_HANDLE
IlrModelConstants.ELEMENT_SUMMARY
IlrModelConstants.ELEMENT_DETAILS
returnedObjectFormat
.List getElementsFromReference(IlrElementHandle handle, org.eclipse.emf.ecore.EReference reference, int returnedObjectFormat, org.eclipse.emf.ecore.EStructuralFeature orderBy) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- if the given element cannot be found
in the database, or if some of the returned values cannot be found before
the end of the transaction.handle
- The element handle.reference
- The EMF reference.returnedObjectFormat
- The format of the objects to be returned.
This can be one of the following:
IlrModelConstants.ELEMENT_HANDLE
IlrModelConstants.ELEMENT_SUMMARY
IlrModelConstants.ELEMENT_DETAILS
orderBy
- The order in which the search results are sorted.
returnedObjectFormat
.IlrElementSummary getElementSummary(IlrElementHandle handle, IlrElementVersion version) throws IlrObjectNotFoundException
IlrObjectNotFoundException
handle
- Handle on the element.version
- Version of the element.
version
of element
.getElementSummary(IlrElementHandle)
,
Code Example,
OverviewIlrElementDetails getElementDetails(IlrElementHandle handle, IlrElementVersion version) throws IlrObjectNotFoundException
IlrObjectNotFoundException
handle
- The element handle.version
- The version of the element.
getElementDetails(IlrElementHandle)
,
getElementSummary(IlrElementHandle, IlrElementVersion)
,
Code Example,
OverviewString[] getHierarchyPath(IlrElementHandle handle) throws IlrObjectNotFoundException
IlrObjectNotFoundException
handle
- The handle of a folder.
List getElementsFromReference(IlrElementHandle handle, org.eclipse.emf.ecore.EReference reference, IlrElementVersion version, int returnedObjectFormat) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- if the given element cannot be found
in the database, or if some of the values cannot be found before the end
of the transaction.handle
- The element handle.reference
- The EMF reference.version
- The version of the element.returnedObjectFormat
- The format of the objects to be returned.
This can be one of the following:
IlrModelConstants.ELEMENT_HANDLE
IlrModelConstants.ELEMENT_SUMMARY
IlrModelConstants.ELEMENT_DETAILS
returnedObjectFormat
.getElementsFromReference(IlrElementHandle, org.eclipse.emf.ecore.EReference, int)
,
Code Example,
OverviewIlrElementDetails getElementDetailsInWorkingBaseline(IlrElementHandle handle) throws IlrObjectNotFoundException
Note: this method does not take the version id of
handle
into account. It looks for the element with the same
original id in the working baseline.
IlrObjectNotFoundException
- if the element does not exist in the
repository.handle
- The handle on the element whose details are needed. This element
must be a brm.ProjectElement
instance.
IlrElementDetails getElementDetailsForThisHandle(IlrElementHandle handle) throws IlrObjectNotFoundException
Note: This method takes the version id of the handle into account, and not that of the working baseline.
IlrObjectNotFoundException
- if the element does not exist in the
repository.handle
- The handle on the element whose details are needed.
IlrElementHandle createElement(org.eclipse.emf.ecore.EClass eclass)
This does not commit anything to the database.
eclass
- The EMF class of the element to be created.
IlrElementHandle commit(IlrCommitableObject cobject) throws IlrApplicationException
This method commits any existing element details of
cobject
to Decision Center, as well as its attached
items. The whole operation is done in a single transaction. If an error occurs
during the commit, the transaction is rolled back.
String documentation = "this is the doc"; String name = "myNewPackage"; final IlrBrmPackage brm = session.getBrmPackage(); EClass rulePackageClass = brm.getRulePackage(); IlrElementHandle packageHandle = session.createElement(rulePackageClass); IlrRulePackage myPackage = (IlrRulePackage)session.getElementDetails(packageHandle); myPackage.setDocumentation(documentation); myPackage.setName(name); myPackage.setRawValue(brm.getRulePackage_Parent(), null); IlrCommitableObject co = new IlrCommitableObject(myPackage); co.setRootDetails(myPackage); session.commit(co);
IlrObjectNotFoundException
- if cobject
is not
new but cannot be found in the database.
IlrInvalidElementException
- if cobject
is invalid.
For example, if the name of a project element is null
.
IlrObjectLockedException
- if cobject
already exists and
is locked by another user.
IlrFolderLockedException
- if the parent folder of
cobject
is recursively locked.
IlrPermissionException
- if the user is not allowed to commit
cobject
.
IlrFrozenBaselineException
- if the working baseline is not a branch
IlrActivityObjectLockedException
IlrApplicationException
cobject
- The committable object to commit.
cobject
is no longer valid and
you must use the updated handle.IlrElementHandle commit(IlrElementDetails details) throws IlrApplicationException
This is equivalent to calling
commit(IlrCommitableObject)
with a committable object whose
root details are set with the given details.
IlrObjectNotFoundException
- if cobject
is not
new but cannot be found in the database.
IlrInvalidElementException
- if cobject
is invalid.
For example, if the name of a project element is null
.
IlrObjectLockedException
- if cobject
already exists and
is locked by another user.
IlrFolderLockedException
- if the parent folder of
cobject
is recursively locked.
IlrPermissionException
- if the user is not allowed to commit
cobject
.
IlrFrozenBaselineException
- if the working baseline is not a branch
IlrActivityObjectLockedException
- if the object is locked by anothe Change Activity.
IlrApplicationException
- if an operation triggered by the commit throws this exception.details
- The details to commit.
cobject
is no longer valid and
you must use the updated handle.commit(IlrCommitableObject)
List<IlrElementHandle> commit(List commitableObjects) throws IlrApplicationException
The whole operation is done in a single transaction. If an error occurs during the commit, the transaction is rolled back.
IlrObjectNotFoundException
- if cobject
is not
new but cannot be found in the database.
IlrInvalidElementException
- if cobject
is invalid.
For example, if the name of a project element is null
.
IlrObjectLockedException
- if cobject
already exists and
is locked by another user.
IlrFolderLockedException
- if the parent folder of
cobject
is recursively locked.
IlrPermissionException
- if the user is not allowed to commit
cobject
.
IlrFrozenBaselineException
- if the working baseline is not a branch
IlrActivityObjectLockedException
IlrApplicationException
commitableObjects
- A list of IlrCommitableObject
.commit(IlrCommitableObject)
ilog.rules.vocabulary.model.IlrVocabularyManager getWorkingVocabulary()
A vocabulary is the set of natural language terms and phrases attached to elements of a business object model and used for rule editing. The vocabularies set in the returned vocabulary are computed following the business object model path of the working baseline.
getWorkingBOM()
ilog.rules.bom.IlrObjectModel getWorkingBOM()
The BOM is a representation of the core concepts of a business and their logical connections. The BOM is the basis for the vocabulary used in business rules. The elements of a BOM map to those of a corresponding execution object model. The BOM is computed following the BOM path of the working baseline.
IlrBaseline getWorkingBaseline()
setWorkingBaseline(ilog.rules.teamserver.brm.IlrBaseline)
,
Code Example,
Overviewvoid setWorkingBaseline(IlrBaseline baseline) throws IlrPermissionException, IlrObjectNotFoundException
When a working baseline is set, all the queries performed with this
session will be filtered by baseline
. For example, if you try
to retrieve all the rules whose status is new
by calling
findElements(ilog.rules.teamserver.model.IlrSearchCriteria)
, the query will return all the rules whose status is
new and that are used by baseline
.
IlrPermissionException
- if the current user is not allowed to access
the project attached to baseline
. This may happen if security is
enforced on the project and none of the groups the user belongs to are
listed in the project groups.
IlrObjectNotFoundException
- if baseline
cannot be found
in the database.baseline
- An instance of the EMF class brm.Baseline
representing a baseline.getWorkingBaseline()
,
getWorkingBOM()
,
getWorkingVocabulary()
,
Code Example,
Overview,
Project Securityvoid setUserLocale(Locale locale)
This locale is used in order to set the generated messages that this session may produce. For example, exceptions, and ruleset generation errors. By default, the locale is set to the locale of the Java Virtual Machine running your custom application.
locale
- The user locale.Locale getUserLocale()
Locale getReferenceLocale()
The reference locale is the locale used to persist the rule artifacts in the database. When editing or viewing a rule in Decision Center, it converts the rule to the user's locale.
This locale is set either by:
preferences.properties
file of the Decision
Center EAR, in which case the locale is global to a deployed EAR; or
void close()
Note: Always call this method when you have finished manipulating a user session. In particular, this method will remove the non-persistent locks that may have been set by the user.
boolean isUserInRole(String role)
role
- The role to test.
true
if the user has the given role.String getUserName()
Date getLoginDate()
List<IlrRuleProject> getAccessibleProjects() throws IlrObjectNotFoundException
A project can be accessed by a user if:
IlrBrmPackage.getBranch_Groups()
for more information.
IlrObjectNotFoundException
- if one of the details of one of the
accessible projects cannot be found
IlrRuleProject
objects.List<IlrBaseline> getAccessibleBaselines(IlrElementHandle ruleProjectHandle) throws IlrObjectNotFoundException
A branch can be accessed by a user if:
IlrBrmPackage.getBranch_Groups()
for more information.
IlrObjectNotFoundException
- if one of the details of one of the
accessible baselines cannot be found.ruleProjectHandle
- The handle of the project for which we search accessible baselines.
IlrBaseline
objects.List<IlrBaseline> getAccessibleChildrenBaselines(IlrBaseline parentBaseline) throws IlrObjectNotFoundException
IlrObjectNotFoundException
parentBaseline
-
IlrElementHandle stringToElementHandle(String idString)
idString
- A string representing the element, produced by the elementHandleToString
method.
elementHandleToString(IlrElementHandle)
String elementHandleToString(IlrElementHandle element)
element
- The element handle.
stringToElementHandle(String)
void deleteElement(IlrElementHandle element) throws IlrApplicationException
IlrCannotDeleteException
- if the object cannot be deleted
because it is referenced by another object. For example, if the element is
a rule package and contains subpackages or some rules.
IlrObjectLockedException
- if the element is locked by another user.
IlrObjectNotFoundException
- if the object to be deleted no longer exists
in the repository.
IlrPermissionException
- if the current user does not have the
rights to delete the element
.
IlrFrozenBaselineException
- TODO
IlrFolderLockedException
- TODO
IlrKnownUUIDException
- TODO
IlrActivityObjectLockedException
IlrApplicationException
element
- The handle on the element to be deleted.void deleteElement(IlrElementHandle element, boolean recursive) throws IlrApplicationException
If the element to delete is a rule package and the recursive
parameter is set to true
, the content of the folder will be
deleted recursively.
This operation is executed in a transaction. If an exception is thrown while an element is being deleted, the whole operation is rolled back. For example, this would happen if a rule contained in a package to be deleted is locked.
IlrCannotDeleteException
- if the object cannot be deleted because
it is referenced by another object. For example, the exception is if you try to delete a
rule R1 that is overridden by a rule R2.
IlrObjectLockedException
- if the element is locked by another user.
IlrObjectNotFoundException
- if the object to be deleted no longer
exists in the repository.
IlrPermissionException
- if the current user does not have the
rights to delete element
.
IlrFrozenBaselineException
- TODO
IlrFolderLockedException
- TODO
IlrKnownUUIDException
- TODO
IlrActivityObjectLockedException
IlrApplicationException
element
- The handle on the element to be deleted.recursive
- Set to true
to delete a rule package and all
its contents.void deleteElements(List<? extends IlrElementHandle> elements, boolean recursive) throws IlrApplicationException
If one of the elements to be deleted is a rule package and the
recursive
parameter is set to true
, the
content of the folder will be deleted recursively.
IlrCannotDeleteException
- if the object cannot be deleted because
it is referenced by another object. For example, this exception is thrown if you try to delete a
rule R1 that is overridden by a rule R2.
IlrObjectLockedException
- if the element is locked by another user.
IlrObjectNotFoundException
- If the object you try to delete does not
exist in the repository.
IlrPermissionException
- if you do not have the permissions to delete
the element.
IlrFrozenBaselineException
- TODO
IlrFolderLockedException
- TODO
IlrKnownUUIDException
- TODO
IlrActivityObjectLockedException
IlrApplicationException
elements
- A list of IlrElementHandle
objects.recursive
- Set to true
to delete a rule package and
all its contents.void deleteElements(List<? extends IlrElementHandle> elements) throws IlrApplicationException
If one of the elements to delete is a rule package and contains some other elements, then an
IlrCannotDeleteException
is thrown.
IlrCannotDeleteException
- if the object cannot be deleted because it is referenced by another object.
For example, this exception is thrown if you try to delete a rule R1 that is overridden by a rule R2.
IlrObjectLockedException
- if the element is locked by another user.
IlrObjectNotFoundException
- if the object you try to delete no longer exists in the repository.
IlrPermissionException
- if you do not have the permissions to delete the element.
IlrFrozenBaselineException
- TODO
IlrFolderLockedException
- TODO
IlrKnownUUIDException
- TODO
IlrActivityObjectLockedException
IlrApplicationException
elements
- List of IlrElementHandle
objects.void restoreVersion(IlrElementHandle element, IlrElementVersion elementVersion) throws IlrApplicationException
IlrPermissionException
- if the element cannot be written because of the permissions.
IlrInvalidElementException
- if the version to restore is invalid.
IlrObjectNotFoundException
- if the given element cannot be found in the database.
IlrObjectLockedException
- if the object to restore is already locked.
IlrFolderLockedException
- if the folder in which the given element is contained is already locked.
IlrCannotRestoreDeleteVersionException
- if the version cannot be restored
IlrActivityObjectLockedException
IlrApplicationException
ilog.rules.teamserver.model.IlrBaselineNotFoundException
- if the working baseline is not set.element
- The handle on the element to be restored.elementVersion
- The version of the element to be restored.IlrModelInfo getModelInfo()
IlrElementVersion getElementVersion(IlrElementHandle element, IlrElementHandle baseline) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- if either element
or
baseline
does not exist in the Decision Center repository.element
- The handle on the element for which you want to retrieve a
specific version.baseline
- The baseline in which the required version of the element
is referenced.
List<IlrElementVersion> getElementVersions(IlrElementHandle element) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- TODOelement
- The handle on the element for which you want to retrieve the
versions.
IlrElementVersion
objects.IlrBrmPackage getBrmPackage()
This is a shortcut to getModelInfo().getBrmPackage()
.
IlrModelInfo.getBrmPackage()
boolean reloadDynamicDomains() throws IlrApplicationException
A dynamic domain is a way of defining the set of possible values for a type. The set of values for a dynamic domain is stored and managed outside the business object model. Changes to the set of values are automatically reflected in the business object model.
IlrApplicationException
true
if some domains were updated.ilog.rules.brl.brldf.IlrBRLVariableProvider getWorkingVariableProvider()
The variables in the returned variable provider gather the variables from the variable set of the project and its dependencies, plus the project parameters.
void eraseProject(IlrRuleProject ruleProject) throws IlrCannotDeleteException, IlrObjectNotFoundException, IlrRoleRestrictedPermissionException, IlrObjectLockedException, IlrPermissionException
This will erase the project, its content, and all its history (artifact versions). The caller must have the role 'rtsAdministrator' to perform it.
IlrCannotDeleteException
- if the project cannot be deleted.
IlrObjectNotFoundException
- if the project cannot be found in the repository.
IlrRoleRestrictedPermissionException
- if the caller does not have "rtsAdministrator" as one of its roles.
IlrObjectLockedException
- if an artifact is locked by another user.
IlrPermissionException
- TODOruleProject
- The rule project to be erased.IlrElementVersion getElementVersion(IlrElementHandle element)
The version is retrieved according to the version id contained in the given handle, as opposed to getElementVersion(IlrElementHandle, IlrElementHandle)
which retrieves the version referenced in the given baseline.
element
- The handle on the element for which we want to retrieve a version.
List copyTo(List sourceElements, IlrElementDetails target, boolean recursive, String duplicatePrefix) throws IlrApplicationException
IlrApplicationException
- if an error occurs during the copy, in which case the whole copy operation is canceled.sourceElements
- A list of IlrElementHandle
objects to copy. These objects must belong to the working
baseline, otherwise an IlrObjectNotFoundException
will be thrown.target
- Either an instance of IlrRulePackage
to designate the package in which the elements must be copied.
The package can be from a baseline other than the working baseline, or an instance of IlrRuleProject
if you want to
copy the elements in the root package of the given project. If null
, the elements will be copied to the root
package of the working baseline.recursive
- If some source elements are rule packages, it indicates whether the copy must be recursive, that is, whether it
must include
all subpackages and package elements (rule artifacts, templates, and so on).duplicatePrefix
- Specifies the string to prepend to the name of each copied element in case an element with
the same name already exists in the target package.
IlrElementHandle
) on the new copied objects.List copyTo(List sourceElements, IlrElementDetails target, IlrBaseline branch, boolean recursive, String duplicatePrefix) throws IlrApplicationException
IlrApplicationException
- if an error occurs during the copy, in which case the whole copy operation is canceled.sourceElements
- A list of IlrElementHandle
objects to copy. These objects must belong to the working
baseline, otherwise an IlrObjectNotFoundException
will be thrown.target
- Either an instance of IlrRulePackage
to designate the package in which the elements must be copied.
The package can be from a baseline other than the working baseline, or an instance of IlrRuleProject
if you want to
copy the elements in the root package of the given project. If null
, the elements will be copied to the root
package of the working baseline.branch
- The branch to use for the target.recursive
- If some source elements are rule packages, it indicates whether the copy must be recursive, that is, whether it
must include
all subpackages and package elements (rule artifacts, templates, and so on).duplicatePrefix
- Specifies the string to prepend to the name of each copied element in case an element with
the same name already exists in the target package.
IlrElementHandle
) on the new copied objects.IlrElementHandle copyTo(IlrElementHandle sourceElement, IlrElementVersion elementVersion, IlrElementDetails target, boolean recursive, String duplicatePrefix) throws IlrApplicationException
IlrApplicationException
- if an error occurs during the copy, in which case the whole copy operation is canceled.sourceElement
- The element to copy. It must belong to the working baseline, otherwise an
IlrObjectNotFoundException
will be thrown.elementVersion
- The version of the element to copy. If null
, the version will be the one referenced in the
current baseline.target
- Either an instance of IlrRulePackage
to designate the package in which the elements must be copied,
which can be from a baseline other than the working baseline, or an instance of IlrRuleProject
if you want to
copy the elements in the root package of the given project. If null
, the elements will be copied to the root
package of the working baseline.recursive
- If the source element is a rule package, indicates whether the copy must be recursive, that is, must include
all subpackages and package elements (rule artifacts, templates, and so on).duplicatePrefix
- Specifies the string to prepend to the name of the copied element in case an element with
the same name already exists in the target package.
IlrElementHandle copyTo(IlrElementHandle sourceElement, IlrElementVersion elementVersion, IlrElementDetails target, IlrBaseline branch, boolean recursive, String duplicatePrefix) throws IlrApplicationException
IlrApplicationException
- if an error occurs during the copy, in which case the whole copy operation is canceled.sourceElement
- The element to copy. It must belong to the working baseline, otherwise an
IlrObjectNotFoundException
will be thrown.elementVersion
- The version of the element to copy. If null
, the version will be the one referenced in the
current baseline.target
- Either an instance of IlrRulePackage
to designate the package in which the elements must be copied,
which can be from a baseline other than the working baseline, or an instance of IlrRuleProject
if you want to
copy the elements in the root package of the given project. If null
, the elements will be copied to the root
package of the working baseline.branch
- The branch to use for the target.recursive
- If the source element is a rule package, indicates whether the copy must be recursive, that is, must include
all subpackages and package elements (rule artifacts, templates, and so on).duplicatePrefix
- Specifies the string to prepend to the name of the copied element in case an element with
the same name already exists in the target package.
void setAttribute(String name, Object value)
IlrRemoteSession
), the bound attributes are
passed back and forth to the server for each call to an IlrSession
method. Thus, setting large objects as session
attributes may have an adverse effect on performance, since the attribute will
be serialized, and sent to the server as an argument of an EJB method. For the same reason, we recommend that you remove
an attribute as soon as you have finished with it.
name
- The name to which the object is bound. It cannot be null
.value
- The object to be bound. It must be serializable and cannot be null
.Object getAttribute(String name)
null
if no object is bound under the name.
name
- A string specifying the name of the object.
Object removeAttribute(String name)
name
- The name of the object to remove from this session.
Iterator<String> getAttributeNames()
|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |