Interface IlrSession
-
- All Superinterfaces:
- ActivityLockingFacility, IlrBaselineManagementFacility, IlrDeploymentFacility, IlrLockingFacility, IlrModelConstants, IlrPermissionsFacility, IlrTestingFacility, java.io.Serializable
public interface IlrSession extends java.io.Serializable, IlrLockingFacility, ActivityLockingFacility, IlrPermissionsFacility, IlrBaselineManagementFacility, IlrDeploymentFacility, IlrTestingFacility, IlrModelConstants
Allows you to connect a registered user to Decision Center. The user can then read data from or write data to the server.Overview
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 anIlrSessionFactory
instance toconnect
to Decision Center and return anIlrSession
instance.Example
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(); }
- See Also:
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
Methods Modifier and Type Method and Description void
beginUsage()
Begin the work on this session.void
close()
Closes the session.IlrElementHandle
commit(IlrBranch branch, IlrCommitableObject cobject)
Commits the given committable object, with all its attached elements, to Decision Center within the given branch.java.util.List<IlrElementHandle>
commit(IlrBranch branch, java.util.List<IlrCommitableObject> commitableObjects)
Commits the given list of committable objects into the working baseline.IlrElementHandle
commit(IlrCommitableObject cobject)
Deprecated.: should use commit(IlrBranch, IlrCommitableObject) to specify in which branch the element should be stored.IlrElementHandle
commit(IlrElementDetails details)
Commits the given element details.java.util.List<IlrElementHandle>
commit(java.util.List commitableObjects)
Deprecated.use commit(IlrBranch, ListIlrElementHandle
copyTo(IlrElementHandle sourceElement, IlrElementVersion elementVersion, IlrElementDetails target, boolean recursive, java.lang.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, java.lang.String duplicatePrefix)
Copies an element or one of its versions in a package.java.util.List
copyTo(java.util.List sourceElements, IlrElementDetails target, boolean recursive, java.lang.String duplicatePrefix)
Copies a list of elements in a package.java.util.List
copyTo(java.util.List sourceElements, IlrElementDetails target, IlrBaseline branch, boolean recursive, java.lang.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(java.util.List<? extends IlrElementHandle> elements)
Deletes the given list of elements from the working project.void
deleteElements(java.util.List<? extends IlrElementHandle> elements, boolean recursive)
Deletes the given list of elements from the working project recursively, if requested.java.lang.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.void
eraseProject(IlrRuleProject ruleProject, boolean withDependencies)
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.java.util.List<IlrCommitableObject>
findElementCommitableObjects(IlrSearchCriteria searchCriteria)
Same function asList findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat)
, returning IlrCommitableObject elements.java.util.List<IlrElementDetails>
findElementDetails(IlrSearchCriteria searchCriteria)
Same function asList findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat)
, returning IlrElementDetails elements.java.util.List<IlrElementHandle>
findElementHandles(IlrSearchCriteria searchCriteria)
Same function asList findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat)
, returning IlrElementHandle elements.java.util.List
findElements(IlrSearchCriteria searchCriteria)
Returns the list of elements matching the given search criteria.java.util.List
findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat)
Returns the elements stored in Decision Center that match the given search criteria.java.util.List<IlrBaseline>
getAccessibleBaselines(IlrElementHandle ruleProjectHandle)
Returns the baselines for given rule project that can be accessed by the current user for this session.java.util.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.java.util.List<IlrRuleProject>
getAccessibleProjects()
Returns the projects that can be accessed by the current user for this session.ilog.rules.teamserver.admin.IlrAdminPackage
getAdminPackage()
Gets the EMF package containing the Administration classes and data types related to administration services.java.lang.Object
getAttribute(java.lang.String name)
Returns the object bound with the specified name in this session.java.util.Iterator<java.lang.String>
getAttributeNames()
Returns an Iterator of String objects containing the names of all the objects bound to this session.ilog.rules.bom.IlrObjectModel
getBOM(IlrBaseline baseline)
Returns the Business Object Model (BOM) for the given baseline.IlrBrmPackage
getBrmPackage()
Gets the EMF package containing the Decision Center classes and data types.IlrDsmPackage
getDsmPackage()
Gets the EMF package containing the Decision Center classes and data types related to decision services.IlrElementDetails
getElementDetails(IlrBaseline baseline, IlrElementHandle handle)
Returns the details of the given element in this baseline.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.java.util.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.java.util.List
getElementsFromReference(IlrElementHandle handle, org.eclipse.emf.ecore.EReference reference, int returnedObjectFormat)
Returns the value of the reference for the given element.java.util.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.java.util.List<IlrElementVersion>
getElementVersions(IlrElementHandle element)
Returns a list containing all versions of a given element stored in Decision Center.java.util.List<IlrElementVersion>
getElementVersions(IlrElementHandle element, IlrBaseline baseline)
Returns a list containing all versions of a given element stored in Decision Center.java.lang.String[]
getHierarchyPath(IlrElementHandle handle)
Returns the hierarchy path of a rule package, that is, a folder.java.util.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.java.util.List
getPossibleValues(IlrElementHandle element, org.eclipse.emf.ecore.EStructuralFeature feature)
Returns the possible values for the given element and feature.java.util.Locale
getReferenceLocale()
Returns the reference locale.java.util.Locale
getUserLocale()
Returns The locale for the current user.java.lang.String
getUserName()
Returns the name of the user connected with this session.IlrValidationPackage
getValidationPackage()
Gets the EMF package containing the Decision Center classes and data types for testing and simulation.ilog.rules.brl.brldf.IlrBRLVariableProvider
getVariableProvider(IlrBaseline baseline)
Returns the variable provider for the given baseline.ilog.rules.vocabulary.model.IlrVocabularyManager
getVocabulary(IlrBaseline baseline)
Returns the vocabulary manager for the given baseline.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(java.lang.String role)
Indicates whether the user has the given role.boolean
reloadDynamicDomains()
Reloads all the dynamic domains present in the BOM.boolean
reloadDynamicDomains(java.util.List<java.lang.String> bomClassNames)
Reloads the dynamic domains selectively.java.lang.Object
removeAttribute(java.lang.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(java.lang.String name, java.lang.Object value)
Binds an object to this session, using the name specified.void
setUserLocale(java.util.Locale locale)
Sets the locale for the current user.void
setWorkingBaseline(IlrBaseline baseline)
Sets the working baseline for this session.IlrElementHandle
stringToElementHandle(java.lang.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, isElementBusy, isPersistentLock, lockBranches, lockElement, lockElement, lockElements, ownsLock, releaseElementLock, releaseElementLocks, releaseNonPersistentLocks, unlockBranches, unlockElement, unlockElements
-
Methods inherited from interface ilog.rules.teamserver.model.ActivityLockingFacility
eltNameLockVisible, getActivityLockOwner, getActivityLockOwner, isActivityElementBusy, isActivityElementBusy, isTakeOwnershipAvailable, isTakeOwnershipAvailable, lockActivityElement, lockActivityElement, ownsActivityLock, ownsActivityLock, releaseActivityLock, releaseActivityLock, takeOwnership, takeOwnership, unlockActivityElements
-
Methods inherited from interface ilog.rules.teamserver.model.permissions.IlrPermissionsFacility
checkPermissionCreate, checkPermissionDelete, checkPermissionDelete, checkPermissionUpdate, checkPermissionUpdate, checkPermissionView, checkPermissionView, commitSecurityProfileData, eraseSecurityProfile, getAvailableGroups, getPermissionableClasses, getSecurityProfileData, isEditable, isHidden, setAvailableGroups
-
Methods inherited from interface ilog.rules.teamserver.model.IlrBaselineManagementFacility
addToBaseline, changeVersionInBaseline, cloneToBranch, cloneToBranch, copyBaseline, createBaseline, createBaselineFromCurrentState, createBaselineFromCurrentState, createBaselineFromCurrentState, createBaselineFromCurrentState, createBranchFromCurrentState, createSnapshotFromBaselineEvent, createSnapshotFromElement, createSnapshotFromElementVersion, deleteBaseline, deleteFromBranch, findArtifactsCausingMergeConflicts, findArtifactsDeletedReadyToMerge, findArtifactsReadyToMerge, getBaselinesForVersion, removeFromBaseline, restoreBaseline, restoreBaseline
-
Methods inherited from interface ilog.rules.teamserver.model.IlrDeploymentFacility
deployDSRuleAppArchive, deployEventProject, deployRuleAppArchive, generateRuleAppArchive, generateRulesetArchive
-
Methods inherited from interface ilog.rules.teamserver.model.IlrTestingFacility
executeScenarioSuite, generateScenarioSuiteArchive
-
-
-
-
Method Detail
-
beginUsage
void beginUsage()
Begin the work on this session. After the call, theIlrSession
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 exampleIlrElementHandle.getValue(EStructuralFeature)
with throw an IllegalStateException ifbeginUsage
has not been called). the following idiom should be used:IlrSession session = factory.getSession(); try { session.beginUsage(); // do some work ... } finally { session.endUsage(); }
-
endUsage
void endUsage()
End the work on this session. After the call, theIlrSession
object is unbound to the current thread. If this method is not called theIlrSession
object will stay attached to the current thread and can be the cause of a memory leak in an application server context.
-
findElements
java.util.List findElements(IlrSearchCriteria searchCriteria) throws IlrObjectNotFoundException, IlrRoleRestrictedPermissionException
Returns the list of elements matching the given search criteria.Calling this method is equivalent to calling
findElements(IlrSearchCriteria, IlrModelConstants.ELEMENT_DETAILS)
.- Throws:
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 isnull
and project elements are found when the current user is not an administrator.- Parameters:
searchCriteria
- The search criteria.- Returns:
- A list of
IlrElementDetails
. - See Also:
- Code Example,
findElements(IlrSearchCriteria, int)
-
findElements
java.util.List findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat) throws IlrObjectNotFoundException, IlrRoleRestrictedPermissionException
Returns the elements stored in Decision Center that match the given search criteria.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.- Throws:
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 isnull
and project elements are found when the current user is not an administrator.- Parameters:
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
- Returns:
- A list of the elements searched for in the format specified by
returnedObjectFormat
. The listed objects will be one of the following types:IlrElementHandle
IlrElementSummary
IlrElementDetails
- See Also:
- Overview, Code Example, Project Security
-
findElementCommitableObjects
java.util.List<IlrCommitableObject> findElementCommitableObjects(IlrSearchCriteria searchCriteria) throws IlrObjectNotFoundException, IlrRoleRestrictedPermissionException
Same function asList findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat)
, returning IlrCommitableObject elements.- Throws:
IlrObjectNotFoundException
IlrRoleRestrictedPermissionException
- Parameters:
searchCriteria
-- Returns:
- A list of the elements searched for, as IlrCommitableObject elements.
-
findElementDetails
java.util.List<IlrElementDetails> findElementDetails(IlrSearchCriteria searchCriteria) throws IlrObjectNotFoundException, IlrRoleRestrictedPermissionException
Same function asList findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat)
, returning IlrElementDetails elements.- Throws:
IlrObjectNotFoundException
IlrRoleRestrictedPermissionException
- Parameters:
searchCriteria
-- Returns:
- A list of the elements searched for, as IlrElementDetails elements.
-
findElementHandles
java.util.List<IlrElementHandle> findElementHandles(IlrSearchCriteria searchCriteria) throws IlrObjectNotFoundException, IlrRoleRestrictedPermissionException
Same function asList findElements(IlrSearchCriteria searchCriteria, int returnedObjectFormat)
, returning IlrElementHandle elements.- Throws:
IlrObjectNotFoundException
IlrRoleRestrictedPermissionException
- Parameters:
searchCriteria
-- Returns:
- A list of the elements searched for, as IlrElementHandle elements.
-
executeQuery
int executeQuery(IlrSearchCriteria searchCriteria) throws IlrApplicationException
Finds the elements matching the given search criteria and executes the action defined in the query.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 new
When 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.- Throws:
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.- Parameters:
searchCriteria
- The search criteria.- Returns:
- The number of objects processed by the query.
- See Also:
- Overview, Code Example
-
getPossibleValues
java.util.List getPossibleValues(IlrElementHandle element, org.eclipse.emf.ecore.EStructuralFeature feature) throws IlrObjectNotFoundException
Returns the possible values for the given element and feature.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 theEEnum
type of the feature.- Throws:
IlrObjectNotFoundException
- ifelement
cannot be found.- Parameters:
element
- The current element.feature
- The enumerated feature. This parameter must be anEEnum
instance.- Returns:
- The list of objects of the Java type of
feature
. - See Also:
- Overview, Code Example
-
getElementDetails
IlrElementDetails getElementDetails(IlrElementHandle handle) throws IlrObjectNotFoundException
Returns the details for the element in Decision Center that corresponds to the given handle.- Throws:
IlrObjectNotFoundException
- ifhandle
cannot be found in the database.- Parameters:
handle
- The handle on the element whose details are needed.- Returns:
- The details corresponding to
handle
according to the following cases:- If
handle
is aproject element
, theIlrElementDetails
instance returned correspond to the version of the element referenced in theworking baseline
. - If the
handle
is not a project element, theIlrElementDetails
instance returned correspond to theexact version
ofhandle
.
- If
- See Also:
- Code Example, Overview
-
getElementSummary
IlrElementSummary getElementSummary(IlrElementHandle handle) throws IlrObjectNotFoundException
Returns the summary for the given element handle.- Throws:
IlrObjectNotFoundException
- ifhandle
cannot be found in the database.- Parameters:
handle
- Handle on the element.- Returns:
- The element summary.
- See Also:
- Code Example, Overview
-
getElementSummaryForThisHandle
IlrElementSummary getElementSummaryForThisHandle(IlrElementHandle handle) throws IlrObjectNotFoundException
Returns the summary that correspond to the exact version of the given element handle.- Throws:
IlrObjectNotFoundException
- ifhandle
cannot be found in the database.- Parameters:
handle
- Handle on the element.- Returns:
- The element summary.
- See Also:
- Code Example, Overview
-
getElementsFromReference
java.util.List getElementsFromReference(IlrElementHandle handle, org.eclipse.emf.ecore.EReference reference, int returnedObjectFormat) throws IlrObjectNotFoundException
Returns the value of the reference for the given element.- Throws:
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.- Parameters:
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
- Returns:
- A list of elements handles, summaries, or details, depending on
the value of
returnedObjectFormat
. - See Also:
- Code Example, Overview
-
getElementsFromReference
java.util.List getElementsFromReference(IlrElementHandle handle, org.eclipse.emf.ecore.EReference reference, int returnedObjectFormat, org.eclipse.emf.ecore.EStructuralFeature orderBy) throws IlrObjectNotFoundException
Returns the value of the reference for the given element.- Throws:
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.- Parameters:
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.- Returns:
- A list of elements handles, summaries, or details, depending on
the value of
returnedObjectFormat
. - See Also:
- Code Example, Overview
-
getElementSummary
IlrElementSummary getElementSummary(IlrElementHandle handle, IlrElementVersion version) throws IlrObjectNotFoundException
Returns the summary of the given element for the given version of the element.- Throws:
IlrObjectNotFoundException
- Parameters:
handle
- Handle on the element.version
- Version of the element.- Returns:
- The summary for the
version
ofelement
. - See Also:
getElementSummary(IlrElementHandle)
, Code Example, Overview
-
getElementDetails
IlrElementDetails getElementDetails(IlrElementHandle handle, IlrElementVersion version) throws IlrObjectNotFoundException
Returns the details of the given element for the given version of the element.- Throws:
IlrObjectNotFoundException
- Parameters:
handle
- The element handle.version
- The version of the element.- Returns:
- The details of the version of the element.
- See Also:
getElementDetails(IlrElementHandle)
,getElementSummary(IlrElementHandle, IlrElementVersion)
, Code Example, Overview
-
getElementDetails
IlrElementDetails getElementDetails(IlrBaseline baseline, IlrElementHandle handle) throws IlrObjectNotFoundException
Returns the details of the given element in this baseline.- Throws:
IlrObjectNotFoundException
- Parameters:
baseline
- The baseline in which the element is searched.handle
- The element handle.- Returns:
- The details of the version of the element.
- See Also:
getElementDetails(IlrElementHandle)
,getElementSummary(IlrElementHandle, IlrElementVersion)
, Code Example, Overview
-
getHierarchyPath
java.lang.String[] getHierarchyPath(IlrElementHandle handle) throws IlrObjectNotFoundException
Returns the hierarchy path of a rule package, that is, a folder.- Throws:
IlrObjectNotFoundException
- Parameters:
handle
- The handle of a folder.- Returns:
- An array containing the hierarchy path of the rule package.
- See Also:
- Code Example, Overview
-
getElementsFromReference
java.util.List getElementsFromReference(IlrElementHandle handle, org.eclipse.emf.ecore.EReference reference, IlrElementVersion version, int returnedObjectFormat) throws IlrObjectNotFoundException
Returns the value of the given reference for the given version of the given element.- Throws:
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.- Parameters:
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
- Returns:
- A list of element handles, summaries, or details, depending on
the value of
returnedObjectFormat
. - See Also:
getElementsFromReference(IlrElementHandle, org.eclipse.emf.ecore.EReference, int)
, Code Example, Overview
-
getElementDetailsInWorkingBaseline
IlrElementDetails getElementDetailsInWorkingBaseline(IlrElementHandle handle) throws IlrObjectNotFoundException
Returns the details of the given element in the working baseline.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.- Throws:
IlrObjectNotFoundException
- if the element does not exist in the repository.- Parameters:
handle
- The handle on the element whose details are needed. This element must be abrm.ProjectElement
instance.- Returns:
- The element details.
- See Also:
- Code Example, Overview
-
getElementDetailsForThisHandle
IlrElementDetails getElementDetailsForThisHandle(IlrElementHandle handle) throws IlrObjectNotFoundException
Returns the details that correspond to the exact version of the given element handle.Note: This method takes the version id of the handle into account, and not that of the working baseline.
- Throws:
IlrObjectNotFoundException
- if the element does not exist in the repository.- Parameters:
handle
- The handle on the element whose details are needed.- Returns:
- The details of the element.
-
createElement
IlrElementHandle createElement(org.eclipse.emf.ecore.EClass eclass)
Creates a handle for the given EMF class.This does not commit anything to the database.
- Parameters:
eclass
- The EMF class of the element to be created.- Returns:
- The element handle.
-
commit
IlrElementHandle commit(IlrCommitableObject cobject) throws IlrApplicationException
Deprecated. : should use commit(IlrBranch, IlrCommitableObject) to specify in which branch the element should be stored.Commits the given committable object, with all its attached elements, to Decision Center. The element is stored in the session working baseline.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);
- Throws:
IlrObjectNotFoundException
- ifcobject
is not new but cannot be found in the database.IlrInvalidElementException
- ifcobject
is invalid. For example, if the name of a project element isnull
.IlrObjectLockedException
- ifcobject
already exists and is locked by another user.IlrFolderLockedException
- if the parent folder ofcobject
is recursively locked.IlrPermissionException
- if the user is not allowed to commitcobject
.IlrFrozenBaselineException
- if the working baseline is not a branch.IlrActivityObjectLockedException
IlrApplicationException
- Parameters:
cobject
- The committable object to commit.- Returns:
- The updated handle of the committed element. Once an object is
committed, the original handle of
cobject
is no longer valid and you must use the updated handle.
-
commit
IlrElementHandle commit(IlrBranch branch, IlrCommitableObject cobject) throws IlrApplicationException
Commits the given committable object, with all its attached elements, to Decision Center within the given branch.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);
- Throws:
IlrObjectNotFoundException
- ifcobject
is not new but cannot be found in the database.IlrInvalidElementException
- ifcobject
is invalid. For example, if the name of a project element isnull
.IlrObjectLockedException
- ifcobject
already exists and is locked by another user.IlrFolderLockedException
- if the parent folder ofcobject
is recursively locked.IlrPermissionException
- if the user is not allowed to commitcobject
.IlrFrozenBaselineException
- if the working baseline is not a branch.IlrActivityObjectLockedException
IlrApplicationException
- Parameters:
branch
- The branch where the element should get stored.cobject
- The committable object to commit.- Returns:
- The updated handle of the committed element. Once an object is
committed, the original handle of
cobject
is no longer valid and you must use the updated handle.
-
commit
IlrElementHandle commit(IlrElementDetails details) throws IlrApplicationException
Commits the given element details.This is equivalent to calling
commit(IlrCommitableObject)
with a committable object whose root details are set with the given details.- Throws:
IlrObjectNotFoundException
- ifcobject
is not new but cannot be found in the database.IlrInvalidElementException
- ifcobject
is invalid. For example, if the name of a project element isnull
.IlrObjectLockedException
- ifcobject
already exists and is locked by another user.IlrFolderLockedException
- if the parent folder ofcobject
is recursively locked.IlrPermissionException
- if the user is not allowed to commitcobject
.IlrFrozenBaselineException
- if the working baseline is not a branchIlrActivityObjectLockedException
- if the object is locked by anothe Change Activity.IlrApplicationException
- if an operation triggered by the commit throws this exception.- Parameters:
details
- The details to commit.- Returns:
- The updated handle of the committed element. Once an object is
committed, the original handle of
cobject
is no longer valid and you must use the updated handle. - See Also:
commit(IlrCommitableObject)
-
commit
java.util.List<IlrElementHandle> commit(java.util.List commitableObjects) throws IlrApplicationException
Deprecated. use commit(IlrBranch, ListCommits the given list of committable objects into the working baseline.The whole operation is done in a single transaction. If an error occurs during the commit, the transaction is rolled back.
- Throws:
IlrObjectNotFoundException
- ifcobject
is not new but cannot be found in the database.IlrInvalidElementException
- ifcobject
is invalid. For example, if the name of a project element isnull
.IlrObjectLockedException
- ifcobject
already exists and is locked by another user.IlrFolderLockedException
- if the parent folder ofcobject
is recursively locked.IlrPermissionException
- if the user is not allowed to commitcobject
.IlrFrozenBaselineException
- if the working baseline is not a branch.IlrActivityObjectLockedException
IlrApplicationException
- Parameters:
commitableObjects
- A list ofIlrCommitableObject
.- See Also:
commit(IlrCommitableObject)
-
commit
java.util.List<IlrElementHandle> commit(IlrBranch branch, java.util.List<IlrCommitableObject> commitableObjects) throws IlrApplicationException
Commits the given list of committable objects into the working baseline.The whole operation is done in a single transaction. If an error occurs during the commit, the transaction is rolled back.
- Throws:
IlrObjectNotFoundException
- ifcobject
is not new but cannot be found in the database.IlrInvalidElementException
- ifcobject
is invalid. For example, if the name of a project element isnull
.IlrObjectLockedException
- ifcobject
already exists and is locked by another user.IlrFolderLockedException
- if the parent folder ofcobject
is recursively locked.IlrPermissionException
- if the user is not allowed to commitcobject
.IlrFrozenBaselineException
- if the working baseline is not a branch.IlrActivityObjectLockedException
IlrApplicationException
- Parameters:
branch
- The branch in which the elements should get stored.commitableObjects
- A list ofIlrCommitableObject
.- See Also:
commit(IlrBranch, IlrCommitableObject)
-
getWorkingVocabulary
ilog.rules.vocabulary.model.IlrVocabularyManager getWorkingVocabulary()
Returns the vocabulary manager for the working baseline.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.
- Returns:
- The vocabulary manager for the working baseline.
- See Also:
getWorkingBOM()
-
getVocabulary
ilog.rules.vocabulary.model.IlrVocabularyManager getVocabulary(IlrBaseline baseline)
Returns the vocabulary manager for the given baseline.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.
- Returns:
- The vocabulary manager for the given baseline.
- See Also:
getBOM(IlrBaseline)
-
getWorkingBOM
ilog.rules.bom.IlrObjectModel getWorkingBOM()
Returns the Business Object Model (BOM) for the current baseline.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.
- Returns:
- The BOM for the working baseline.
- See Also:
- Code Example, Overview
-
getBOM
ilog.rules.bom.IlrObjectModel getBOM(IlrBaseline baseline)
Returns the Business Object Model (BOM) for the given baseline.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.
- Returns:
- The BOM for the given baseline.
- See Also:
- Code Example, Overview
-
getWorkingBaseline
IlrBaseline getWorkingBaseline()
Returns the working baseline.
-
setWorkingBaseline
void setWorkingBaseline(IlrBaseline baseline) throws IlrPermissionException, IlrObjectNotFoundException
Sets the working baseline for this session.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 isnew
by callingfindElements(ilog.rules.teamserver.model.IlrSearchCriteria)
, the query will return all the rules whose status is new and that are used bybaseline
.- Throws:
IlrPermissionException
- if the current user is not allowed to access the project attached tobaseline
. 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
- ifbaseline
cannot be found in the database.- Parameters:
baseline
- An instance of the EMF classbrm.Baseline
representing a baseline.- See Also:
getWorkingBaseline()
,getWorkingBOM()
,getWorkingVocabulary()
, Code Example, Overview, Project Security
-
setUserLocale
void setUserLocale(java.util.Locale locale)
Sets the locale for the current user.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.
- Parameters:
locale
- The user locale.
-
getUserLocale
java.util.Locale getUserLocale()
Returns The locale for the current user.- Returns:
- The user locale.
-
getReferenceLocale
java.util.Locale getReferenceLocale()
Returns the reference locale.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:
- editing the
preferences.properties
file of the Decision Center EAR, in which case the locale is global to a deployed EAR; or - using a configuration parameter of the database, in which case the change is local to the data source. See the ANT tasks reference manual for more information.
- Returns:
- The reference locale for this session.
- editing the
-
close
void close()
Closes the session.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.
-
isUserInRole
boolean isUserInRole(java.lang.String role)
Indicates whether the user has the given role.- Parameters:
role
- The role to test.- Returns:
true
if the user has the given role.- See Also:
- Project Security
-
getUserName
java.lang.String getUserName()
Returns the name of the user connected with this session.- Returns:
- The name of the current user.
- See Also:
- Overview
-
getLoginDate
java.util.Date getLoginDate()
Returns the date the user connected with this session logged into Decision Center.- Returns:
- The login date.
- See Also:
- Overview
-
getAccessibleProjects
java.util.List<IlrRuleProject> getAccessibleProjects() throws IlrObjectNotFoundException
Returns the projects that can be accessed by the current user for this session.A project can be accessed by a user if:
- The user is an administrator.
- The branch security is disabled: this is the default behavior.
- The branch security is enabled and one of the roles of the user is
in the list of groups that can access one of the branches of the project. See
IlrBrmPackage.getBranch_Groups()
for more information.
- Throws:
IlrObjectNotFoundException
- if one of the details of one of the accessible projects cannot be found- Returns:
- A list of
IlrRuleProject
objects. - See Also:
- Project Security
-
getAccessibleBaselines
java.util.List<IlrBaseline> getAccessibleBaselines(IlrElementHandle ruleProjectHandle) throws IlrObjectNotFoundException
Returns the baselines for given rule project that can be accessed by the current user for this session.A branch can be accessed by a user if:
- The user is an administrator.
- The branch security is disabled: this is the default behavior.
- The branch security is enabled and one of the roles of the user is
in the list of groups that can access the branch. See
IlrBrmPackage.getBranch_Groups()
for more information.
- Throws:
IlrObjectNotFoundException
- if one of the details of one of the accessible baselines cannot be found.- Parameters:
ruleProjectHandle
- The handle of the project for which we search accessible baselines.- Returns:
- A list of
IlrBaseline
objects.
-
getAccessibleChildrenBaselines
java.util.List<IlrBaseline> getAccessibleChildrenBaselines(IlrBaseline parentBaseline) throws IlrObjectNotFoundException
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. This is the same function as above, but it returns only baselines that are direct children of the one given in parameter.- Throws:
IlrObjectNotFoundException
- Parameters:
parentBaseline
-- Returns:
- The list of direct children baselines that can be accessed by this session.
-
stringToElementHandle
IlrElementHandle stringToElementHandle(java.lang.String idString)
Returns the element handle corresponding to the given string.- Parameters:
idString
- A string representing the element, produced by theelementHandleToString
method.- Returns:
- The handle on the element to be retrieved.
- See Also:
elementHandleToString(IlrElementHandle)
-
elementHandleToString
java.lang.String elementHandleToString(IlrElementHandle element)
Returns a string serialization of the given element.- Parameters:
element
- The element handle.- Returns:
- A String that represents the handle.
- See Also:
stringToElementHandle(String)
-
deleteElement
void deleteElement(IlrElementHandle element) throws IlrApplicationException
Deletes the given element from the working project.- Throws:
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 theelement
.IlrFrozenBaselineException
- TODOIlrFolderLockedException
- TODOIlrKnownUUIDException
- TODOIlrActivityObjectLockedException
IlrApplicationException
- Parameters:
element
- The handle on the element to be deleted.- See Also:
- Project Security, Versions and Baselines
-
deleteElement
void deleteElement(IlrElementHandle element, boolean recursive) throws IlrApplicationException
Deletes the given element from the working project recursively on request.If the element to delete is a rule package and the
recursive
parameter is set totrue
, 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.
- Throws:
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 deleteelement
.IlrFrozenBaselineException
- TODOIlrFolderLockedException
- TODOIlrKnownUUIDException
- TODOIlrActivityObjectLockedException
IlrApplicationException
- Parameters:
element
- The handle on the element to be deleted.recursive
- Set totrue
to delete a rule package and all its contents.- See Also:
- Project Security, Versions and Baselines
-
deleteElements
void deleteElements(java.util.List<? extends IlrElementHandle> elements, boolean recursive) throws IlrApplicationException
Deletes the given list of elements from the working project recursively, if requested.If one of the elements to be deleted is a rule package and the
recursive
parameter is set totrue
, the content of the folder will be deleted recursively.- Throws:
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
- TODOIlrFolderLockedException
- TODOIlrKnownUUIDException
- TODOIlrActivityObjectLockedException
IlrApplicationException
- Parameters:
elements
- A list ofIlrElementHandle
objects.recursive
- Set totrue
to delete a rule package and all its contents.- See Also:
- Project Security, Versions and Baselines
-
deleteElements
void deleteElements(java.util.List<? extends IlrElementHandle> elements) throws IlrApplicationException
Deletes the given list of elements from the working project.If one of the elements to delete is a rule package and contains some other elements, then an
IlrCannotDeleteException
is thrown.- Throws:
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
- TODOIlrFolderLockedException
- TODOIlrKnownUUIDException
- TODOIlrActivityObjectLockedException
IlrApplicationException
- Parameters:
elements
- List ofIlrElementHandle
objects.- See Also:
- Project Security, Versions and Baselines
-
restoreVersion
void restoreVersion(IlrElementHandle element, IlrElementVersion elementVersion) throws IlrApplicationException
Restores the given version of the given element.- Throws:
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 restoredIlrActivityObjectLockedException
IlrApplicationException
ilog.rules.teamserver.model.IlrBaselineNotFoundException
- if the working baseline is not set.- Parameters:
element
- The handle on the element to be restored.elementVersion
- The version of the element to be restored.- See Also:
- Versions and Baselines
-
getModelInfo
IlrModelInfo getModelInfo()
Returns the model info object describing the business rule model of Decision Center.- Returns:
- The model info for Decision Center.
-
getElementVersion
IlrElementVersion getElementVersion(IlrElementHandle element, IlrElementHandle baseline) throws IlrObjectNotFoundException
Returns the version of the given element that is referenced by the given baseline.- Throws:
IlrObjectNotFoundException
- if eitherelement
orbaseline
does not exist in the Decision Center repository.- Parameters:
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.- Returns:
- The version of the element in the baseline.
- See Also:
- Versions and Baselines
-
getElementVersions
java.util.List<IlrElementVersion> getElementVersions(IlrElementHandle element) throws IlrObjectNotFoundException
Returns a list containing all versions of a given element stored in Decision Center.- Throws:
IlrObjectNotFoundException
- TODO- Parameters:
element
- The handle on the element for which you want to retrieve the versions.- Returns:
- A list of
IlrElementVersion
objects. - See Also:
- Versions and Baselines
-
getElementVersions
java.util.List<IlrElementVersion> getElementVersions(IlrElementHandle element, IlrBaseline baseline) throws IlrObjectNotFoundException
Returns a list containing all versions of a given element stored in Decision Center.- Throws:
IlrObjectNotFoundException
- Parameters:
element
- The handle on the element for which you want to retrieve the versions.baseline
- The baseline in which you want to retrieve the versions.- Returns:
- A list of
IlrElementVersion
objects. - See Also:
- Versions and Baselines
-
getBrmPackage
IlrBrmPackage getBrmPackage()
Gets the EMF package containing the Decision Center classes and data types.This is a shortcut to
getModelInfo().getBrmPackage()
.- Returns:
- An EMF EPackage.
- See Also:
IlrModelInfo.getBrmPackage()
-
getValidationPackage
IlrValidationPackage getValidationPackage()
Gets the EMF package containing the Decision Center classes and data types for testing and simulation.This is a shortcut to
getModelInfo().getValidationPackage()
.- Returns:
- An EMF EPackage.
- See Also:
IlrModelInfo.getValidationPackage()
-
getDsmPackage
IlrDsmPackage getDsmPackage()
Gets the EMF package containing the Decision Center classes and data types related to decision services.This is a shortcut to
getModelInfo().getDsmPackage()
.- Returns:
- An EMF EPackage.
- See Also:
IlrModelInfo.getDsmPackage()
-
getAdminPackage
ilog.rules.teamserver.admin.IlrAdminPackage getAdminPackage()
Gets the EMF package containing the Administration classes and data types related to administration services.This is a shortcut to
getModelInfo().getAdminPackage()
.- Returns:
- An EMF EPackage.
- See Also:
IlrModelInfo.getDsmPackage()
-
reloadDynamicDomains
boolean reloadDynamicDomains() throws IlrApplicationException
Reloads all the dynamic domains present in the BOM.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.
- Throws:
IlrApplicationException
- Returns:
- Returns
true
if some domains were updated.
-
reloadDynamicDomains
boolean reloadDynamicDomains(java.util.List<java.lang.String> bomClassNames) throws IlrApplicationException
Reloads the dynamic domains selectively.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.
- Throws:
IlrApplicationException
- Parameters:
bomClassNames
- The list of BOM class names to reload the domains from.- Returns:
true
if some domains were updated.
-
getWorkingVariableProvider
ilog.rules.brl.brldf.IlrBRLVariableProvider getWorkingVariableProvider()
Returns the variable provider for the working baseline.The variables in the returned variable provider gather the variables from the variable set of the project and its dependencies, plus the project parameters.
- Since:
- JRules 6.5
- Returns:
- The variable provider for the working baseline.
-
getVariableProvider
ilog.rules.brl.brldf.IlrBRLVariableProvider getVariableProvider(IlrBaseline baseline)
Returns the variable provider for the given baseline.The variables in the returned variable provider gather the variables from the variable set of the project and its dependencies, plus the project parameters.
- Returns:
- The variable provider for the given baseline.
-
eraseProject
void eraseProject(IlrRuleProject ruleProject) throws IlrCannotDeleteException, IlrObjectNotFoundException, IlrRoleRestrictedPermissionException, IlrObjectLockedException, IlrPermissionException
Erases a project from the database.This will erase the project, its content, and all its history (artifact versions). The caller must have the role 'rtsAdministrator' to perform it.
- Throws:
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
- TODO- Parameters:
ruleProject
- The rule project to be erased.- See Also:
- Code Example, Rule Projects, Project Security
-
eraseProject
void eraseProject(IlrRuleProject ruleProject, boolean withDependencies) throws IlrCannotDeleteException, IlrObjectNotFoundException, IlrRoleRestrictedPermissionException, IlrObjectLockedException, IlrPermissionException
Erases a project from the database.This will erase the project, its content, and all its history (artifact versions). The caller must have the role 'rtsAdministrator' to perform it.
- Throws:
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
- TODO- Parameters:
ruleProject
- The rule project to be erased.withDependencies
- Indicates whether the projects thatruleProject
depends on should be deleted as well.- See Also:
- Code Example, Rule Projects, Project Security
-
getElementVersion
IlrElementVersion getElementVersion(IlrElementHandle element)
Returns the version information corresponding to the given 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.- Since:
- JRules 6.5
- Parameters:
element
- The handle on the element for which we want to retrieve a version.- Returns:
- The version of the element.
-
copyTo
java.util.List copyTo(java.util.List sourceElements, IlrElementDetails target, boolean recursive, java.lang.String duplicatePrefix) throws IlrApplicationException
Copies a list of elements in a package.- Since:
- JRules 6.6
- Throws:
IlrApplicationException
- if an error occurs during the copy, in which case the whole copy operation is canceled.- Parameters:
sourceElements
- A list ofIlrElementHandle
objects to copy. These objects must belong to the working baseline, otherwise anIlrObjectNotFoundException
will be thrown.target
- Either an instance ofIlrRulePackage
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 ofIlrRuleProject
if you want to copy the elements in the root package of the given project. Ifnull
, 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.- Returns:
- A list of handles (
IlrElementHandle
) on the new copied objects.
-
copyTo
java.util.List copyTo(java.util.List sourceElements, IlrElementDetails target, IlrBaseline branch, boolean recursive, java.lang.String duplicatePrefix) throws IlrApplicationException
Copies a list of elements in a package.- Since:
- JRules 6.6
- Throws:
IlrApplicationException
- if an error occurs during the copy, in which case the whole copy operation is canceled.- Parameters:
sourceElements
- A list ofIlrElementHandle
objects to copy. These objects must belong to the working baseline, otherwise anIlrObjectNotFoundException
will be thrown.target
- Either an instance ofIlrRulePackage
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 ofIlrRuleProject
if you want to copy the elements in the root package of the given project. Ifnull
, 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.- Returns:
- A list of handles (
IlrElementHandle
) on the new copied objects.
-
copyTo
IlrElementHandle copyTo(IlrElementHandle sourceElement, IlrElementVersion elementVersion, IlrElementDetails target, boolean recursive, java.lang.String duplicatePrefix) throws IlrApplicationException
Copies an element or one of its versions in a package.- Since:
- JRules 6.6
- Throws:
IlrApplicationException
- if an error occurs during the copy, in which case the whole copy operation is canceled.- Parameters:
sourceElement
- The element to copy. It must belong to the working baseline, otherwise anIlrObjectNotFoundException
will be thrown.elementVersion
- The version of the element to copy. Ifnull
, the version will be the one referenced in the current baseline.target
- Either an instance ofIlrRulePackage
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 ofIlrRuleProject
if you want to copy the elements in the root package of the given project. Ifnull
, 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.- Returns:
- A handle on the new copied object.
-
copyTo
IlrElementHandle copyTo(IlrElementHandle sourceElement, IlrElementVersion elementVersion, IlrElementDetails target, IlrBaseline branch, boolean recursive, java.lang.String duplicatePrefix) throws IlrApplicationException
Copies an element or one of its versions in a package.- Since:
- JRules 6.6
- Throws:
IlrApplicationException
- if an error occurs during the copy, in which case the whole copy operation is canceled.- Parameters:
sourceElement
- The element to copy. It must belong to the working baseline, otherwise anIlrObjectNotFoundException
will be thrown.elementVersion
- The version of the element to copy. Ifnull
, the version will be the one referenced in the current baseline.target
- Either an instance ofIlrRulePackage
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 ofIlrRuleProject
if you want to copy the elements in the root package of the given project. Ifnull
, 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.- Returns:
- A handle on the new copied object.
-
setAttribute
void setAttribute(java.lang.String name, java.lang.Object value)
Binds an object to this session, using the name specified. If an object of the same name is already bound to the session, it is replaced. A typical use of session attributes is to set some data on the session and to retrieve it server-side; for example, in an extractor validator (see IlrExtractorValidator), in order to select a rule at extraction time. NOTE: When an attribute is set on a remote session (such asIlrRemoteSession
), the bound attributes are passed back and forth to the server for each call to anIlrSession
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.- Parameters:
name
- The name to which the object is bound. It cannot benull
.value
- The object to be bound. It must be serializable and cannot benull
.
-
getAttribute
java.lang.Object getAttribute(java.lang.String name)
Returns the object bound with the specified name in this session. It returnsnull
if no object is bound under the name.- Parameters:
name
- A string specifying the name of the object.- Returns:
- The object with the specified name.
-
removeAttribute
java.lang.Object removeAttribute(java.lang.String name)
Removes the object bound with the specified name from this session. If the session does not have an object bound with the specified name, this method does nothing.- Parameters:
name
- The name of the object to remove from this session.- Returns:
- The object with the specified name.
-
getAttributeNames
java.util.Iterator<java.lang.String> getAttributeNames()
Returns an Iterator of String objects containing the names of all the objects bound to this session.- Returns:
- An Iterator of String objects specifying the names of all the objects bound to this session.
-
-