ilog.rules.teamserver.model

Interface IlrSession

    • Method Detail

      • beginUsage

        void beginUsage()
        Begin the work on this session. After the call, the 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(); }
      • endUsage

        void endUsage()
        End the work on this session. After the call, the 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.
      • 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 is null 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
      • 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
      • 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
      • 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 a brm.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 - 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
        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 - 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
        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.
      • 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
      • 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.
      • 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.
        Then baselines can be accessed if they are created in a branch that the user can access. The list is sorted according to the baseline names.
        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 the elementHandleToString 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)
      • getModelInfo

        IlrModelInfo getModelInfo()
        Returns the model info object describing the business rule model of Decision Center.
        Returns:
        The model info for Decision Center.
      • 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.
      • 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 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.
        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 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.
        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 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.
        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 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.
        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 as 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.
        Parameters:
        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.
      • getAttribute

        java.lang.Object getAttribute(java.lang.String name)
        Returns the object bound with the specified name in this session. It returns null 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.

© Copyright IBM Corp. 1987, 2015