ilog.rules.teamserver.model

Class IlrSessionHelper

  • java.lang.Object
    • ilog.rules.teamserver.model.IlrSessionHelper
    • Constructor Detail

      • IlrSessionHelper

        public IlrSessionHelper()
    • Method Detail

      • setDefinition

        public static void setDefinition(IlrSession session,
                         IlrElementHandle ruleArtifact,
                         java.lang.String body)
                                  throws IlrApplicationException
        Sets the definition of the given rule.

        Throws:
        IlrApplicationException - If something wrong happens during the operation.
        Parameters:
        session - The session to use in order to perform the operation.
        ruleArtifact - The rule artifact of which we want to change the definition.
        body - The body of the definition (that is, the text of the rule or query).
      • getProjects

        public static java.util.List<IlrRuleProject> getProjects(IlrSession session)
        Gets all the projects contained in the repository ordered by project name.

        Parameters:
        session - The session to use to perform the search.
        Returns:
        A list of ilog.rules.teamserver.brm.IlrRuleProject objects.
      • getProjectNamed

        public static IlrRuleProject getProjectNamed(IlrSession session,
                                     java.lang.String name)
                                              throws IlrObjectNotFoundException
        Gets the project with the given name.

        Throws:
        IlrObjectNotFoundException
        Parameters:
        session - The session to use to perform the search.
        name - The name of the searched project.
        Returns:
        A rule project or null if the project cannot be found.
      • createProject

        public static IlrElementHandle createProject(IlrSession session,
                                     java.lang.String name)
                                              throws IlrApplicationException
        Deprecated. Use createRuleProject() instead.
        Creates and sets up a project with the given name.

        By default a project is set up to contain:

        • A Business Rules view
        • A Templates view
        • A Ruleflows view
        • An empty rule template for each subtype of brm.BRLRule
        Also, the category list of the project is set to { any }.
        Throws:
        IlrApplicationException - If an error happens when creating the project.
        Parameters:
        session - The session to use to perform the operation.
        name - Name of the project to create.
        Returns:
        Handle on the created project.
      • createRuleProject

        public static IlrRuleProject createRuleProject(IlrSession session,
                                       java.lang.String name)
                                                throws IlrApplicationException
        Creates and sets up a project with the given name.

        By default a project is set up to contain:

        • A Business Rules view
        • A Templates view
        • A Ruleflows view
        • An empty rule template for each subtype of brm.BRLRule
        Also, the category list of the project is set to { any }.
        Throws:
        IlrApplicationException - If an error happens when creating the project.
        Parameters:
        session - The session to use to perform the operation.
        name - The name of the project to create.
        Returns:
        The created project.
      • createEventProject

        public static IlrRuleProject createEventProject(IlrSession session,
                                        java.lang.String name)
                                                 throws IlrApplicationException
        Creates and sets up an event project with the given name.

        By default a project is set up to contain the following smart views:

        • Rules
        • Filters
        • Named Constants
        • Events
        • Actions
        • Business Objects
        Since:
        7.5
        Throws:
        IlrApplicationException - If an error happens when creating the project.
        Parameters:
        session - The session to use to perform the operation.
        name - The name of the event project to create.
        Returns:
        The created project.
      • getElementsFromPath

        public static java.util.List getElementsFromPath(IlrSession session,
                                         java.lang.String path)
                                                  throws IlrObjectNotFoundException
        Gets the project elements corresponding to the given path.

        This method works for elements stored in rule packages (that is, their package kind is IlrPackageKind.RULE_LITERAL).

        Throws:
        IlrObjectNotFoundException
        Parameters:
        path - A path with the format: [<project>:[<branchPath>:]](/packageName)*[/packageElementName]. Example: myProject:myFolder/mySubFolder/myRule. If no project prefix is specified then we consider that the project is the one of the working baseline of the given session.
        Returns:
        A list of IlrElementDetails objects.
        See Also:

      • getElementsFromPath

        public static java.util.List getElementsFromPath(IlrSession session,
                                         java.lang.String path,
                                         IlrPackageKind packageKind)
                                                  throws IlrObjectNotFoundException
        Gets the project elements corresponding to the given path.

        Throws:
        IlrObjectNotFoundException
        Parameters:
        path - A path with the format: [<project>:[<branchPath>:]](/packageName)*[/packageElementName]. Example: myProject:myFolder/mySubFolder/myRule. If no project prefix is specified then we consider that the project is the one of the working baseline of the given session.
        packageKind - Can be IlrPackageKind.RULE_LITERAL, IlrPackageKind.TEMPLATE_LITERAL, IlrPackageKind.TESTING_LITERAL etc.
        Returns:
        A list of IlrElementDetails objects.
        See Also:
        IlrPackageKind
      • getElementFromPath

        public static IlrElementDetails getElementFromPath(IlrSession session,
                                           java.lang.String path)
                                                    throws IlrObjectNotFoundException
        Gets the project element corresponding to the given path.

        This method works for elements stored in rule packages (that is, their package kind is IlrPackageKind.RULE_LITERAL).

        Throws:
        IlrObjectNotFoundException
        Parameters:
        path - A path with the format: [<project>:[<branchPath>:]](/packageName)*[/packageElementName]. Example: myProject:myFolder/mySubFolder/myRule. If no project prefix is specified then we consider that the project is the one of the working baseline of the given session.
        Returns:
        An IlrElementDetails objects. If several objects matching the path are found, the first one is returned.
        See Also:

      • getElementFromPath

        public static IlrElementDetails getElementFromPath(IlrSession session,
                                           java.lang.String path,
                                           IlrPackageKind packageKind)
                                                    throws IlrObjectNotFoundException
        Gets the project element corresponding to the given path.

        Throws:
        IlrObjectNotFoundException
        Parameters:
        path - A path with the format: [<project>:[<branchPath>:]](/packageName)*[/packageElementName]. Example: myProject:myFolder/mySubFolder/myRule. If no project prefix is specified then we consider that the project is the one of the working baseline of the given session.
        packageKind - Can be IlrPackageKind.RULE_LITERAL, IlrPackageKind.TEMPLATE_LITERAL, IlrPackageKind.TESTING_LITERAL etc.
        Returns:
        An IlrElementDetails objects. If several objects matching the path are found, the first one is returned.
        See Also:
        IlrPackageKind
      • getRecyclebinBaseline

        public static IlrBaseline getRecyclebinBaseline(IlrSession session,
                                        IlrBranch parentBranch)
                                                 throws IlrObjectNotFoundException
        Gets the recycle bin baseline for the given branch. A dedicated recycle bin is associated to every branch. This method will return the recycle bin associated to the given branch.

        Throws:
        IlrObjectNotFoundException - If the project cannot be found.
        Parameters:
        session - The session to use to perform the operation.
        parentBranch - The branch for which to retrieve the recycle bin.
        Returns:
        The recycle bin baseline.
      • getBaselineNamed

        public static IlrBaseline getBaselineNamed(IlrSession session,
                                   IlrElementHandle project,
                                   java.lang.String name)
                                            throws IlrObjectNotFoundException
        Gets the baseline with the given name, for the given project.

        Throws:
        IlrObjectNotFoundException
        Parameters:
        session - The session to use to perform the operation.
        project - Handle on the project.
        name - The requested name.
        Returns:
        A baseline or null if the baseline cannot be found.
      • getDeployedBaselines

        public static java.util.List<IlrBaseline> getDeployedBaselines(IlrSession session,
                                                       IlrElementHandle ruleAppHandle)
        Returns the list of deployment baselines that were created using this RuleApp.
        Parameters:
        session - The session to use to perform the operation.
        ruleAppHandle - Handle on the RuleApp.
        Returns:
        The list of deployment baselines.
      • getDeployedBaselinesNames

        public static java.util.List<java.lang.String> getDeployedBaselinesNames(IlrSession session,
                                                                 IlrElementHandle ruleAppHandle)
        Returns the list of deployment baselines names that were created using this RuleApp.
        Parameters:
        session - The session to use to perform the operation.
        ruleAppHandle - Handle on the RuleApp.
        Returns:
        The list of deployment baselines names.
      • createBOM

        public static IlrBOM createBOM(IlrSession session,
                       java.lang.String name,
                       java.lang.String body,
                       boolean createBOMEntry)
                                throws IlrApplicationException
        Creates a BOM with the given name and body.

        Throws:
        IlrApplicationException - If something wrong happens during the operation.
        Parameters:
        session - The session to use to perform the operation.
        name - The requested name.
        body - The requested body.
        createBOMEntry - If true, a BOM entry is created in the project along with the committed BOM.
        Returns:
        A BOM.
      • createBOM2XOMMapping

        public static IlrBOM2XOMMapping createBOM2XOMMapping(IlrSession session,
                                             java.lang.String name,
                                             java.lang.String body)
                                                      throws IlrApplicationException
        Creates a B2X with the given name and body.

        Throws:
        IlrApplicationException - If something wrong happens during the operation.
        Parameters:
        session - The session to use to perform the operation.
        name - The requested name.
        body - The requested body.
        Returns:
        A B2X.
      • createVocabulary

        public static IlrVocabulary createVocabulary(IlrSession session,
                                     java.lang.String name,
                                     java.lang.String body,
                                     java.util.Locale locale)
                                              throws IlrApplicationException
        Creates a vocabulary with the given name and body.
        Throws:
        IlrApplicationException - If something wrong happens during the operation.
        Parameters:
        session - The session to use to perform the operation.
        name - The requested name.
        body - The requested body.
        locale - The locale of the vocabulary.
        Returns:
        A vocabulary.
      • createDependency

        public static void createDependency(IlrSession session,
                            IlrRuleProject src,
                            IlrRuleProject dest,
                            boolean createProjectBOMEntry)
                                     throws IlrApplicationException
        Creates a dependency between the given projects, for their current baselines.
        Throws:
        IlrApplicationException - If an error occurs while creating the new dependency.
        Parameters:
        session - The session to use to perform the operation.
        src - The source project.
        dest - The destination project.
        createProjectBOMEntry - If true, a "Project BOM entry" is also created in the source project so that the BOM path of the source project will include the BOM path of the destination project.
      • createFromTemplate

        public static IlrCommitableObject createFromTemplate(IlrSession session,
                                             IlrTemplate template)
                                                      throws IlrObjectNotFoundException
        Instantiates a rule from the given template.

        Note: This does not commit anything.

        Throws:
        IlrObjectNotFoundException - If the template cannot be found in the database.
        Parameters:
        session - The session to use to perform the operation.
        template - The template to use to instantiate the rule.
        Returns:
        A committable object.
      • makeBuildCriteria

        public static IlrSearchCriteria makeBuildCriteria(IlrSession session,
                                          IlrQuery query)
        Builds a search criteria from the query.

        Parameters:
        session - The session.
        query - The query to use.
        Returns:
        A search criteria.
      • setBOMPath

        public static void setBOMPath(IlrSession session,
                      IlrBaseline baseline,
                      java.util.List bomPathEntries)
                               throws IlrApplicationException
        Sets the BOM path of the given baseline.

        This methods first clears the old BOM path, if any, and inserts the new one, in the order specified by the list.

        Throws:
        IlrApplicationException
        Parameters:
        session - The session.
        baseline - The baseline on which the BOM path will be set.
        bomPathEntries - A list of IlrBOM or IlrRuleProject objects, ordered according to the desired BOM path.
      • makeVariableProvider

        public static ilog.rules.brl.brldf.IlrBRLVariableProvider makeVariableProvider(IlrSession session)
                                                                                throws IlrApplicationException
        Deprecated. Use IlrSession#getWorkingVariableProvider() instead.
        Creates a variable provider for the given session.

        Throws:
        IlrApplicationException - If something wrong happens.
        Parameters:
        session - The session.
        Returns:
        A variable provider.
      • createActionRule

        public static IlrActionRule createActionRule(IlrSession session)
        Deprecated. Use newActionRule(IlrSession) instead.
        Creates an action rule.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        An action rule.
      • newActionRule

        public static IlrActionRule newActionRule(IlrSession session)
        Creates an action rule.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        An action rule.
      • createRulePackage

        public static IlrRulePackage createRulePackage(IlrSession session)
        Deprecated. Use #newRulePackage(IlrSession) instead.
        Creates a rule package.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        A rule package.
      • newRulePackage

        public static IlrRulePackage newRulePackage(IlrSession session)
        Creates a rule package.

        This simply creates a new object, but does not commit it in the database. This method create a rule package (that is, its package kind is IlrPackageKind.RULE_LITERAL).

        Parameters:
        session - The session.
        Returns:
        A rule package.
        See Also:
        newRulePackage(IlrSession, IlrPackageKind)
      • newRulePackage

        public static IlrRulePackage newRulePackage(IlrSession session,
                                    IlrPackageKind packageKind)
        Creates a package.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        packageKind - Can be IlrPackageKind.RULE_LITERAL, IlrPackageKind.TEMPLATE_LITERAL, IlrPackageKind.TESTING_LITERAL etc.
        Returns:
        A package.
        See Also:
        IlrPackageKind
      • createQuery

        public static IlrQuery createQuery(IlrSession session)
        Deprecated. Use #newQuery(IlrSession) instead.
        Creates a query.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The query created.
      • newQuery

        public static IlrQuery newQuery(IlrSession session)
        Creates a query.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The query created.
      • createBOM

        public static IlrBOM createBOM(IlrSession session)
        Deprecated. Use #newBOM(IlrSession) instead.
        Creates a BOM.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The BOM created.
      • newBOM

        public static IlrBOM newBOM(IlrSession session)
        Creates a BOM.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The BOM created.
      • createVocabulary

        public static IlrVocabulary createVocabulary(IlrSession session)
        Deprecated. Use #newVocabulary(IlrSession) instead.
        Creates a vocabulary.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The vocabulary created.
      • newVocabulary

        public static IlrVocabulary newVocabulary(IlrSession session)
        Creates a vocabulary.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The vocabulary created.
      • createExtractor

        public static IlrExtractor createExtractor(IlrSession session)
        Deprecated. Use #newExtractor(IlrSession) instead.
        Creates an extractor.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The extractor created.
      • newExtractor

        public static IlrExtractor newExtractor(IlrSession session)
        Creates an extractor.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The extractor created.
      • createTag

        public static IlrTag createTag(IlrSession session)
        Deprecated. Use #newTag(IlrSession) instead.
        Creates a tag.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The tag created.
      • newTag

        public static IlrTag newTag(IlrSession session)
        Creates a tag.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The tag created.
      • createTemplate

        public static IlrTemplate createTemplate(IlrSession session)
        Deprecated. Use #newTemplate(IlrSession) instead.
        Creates a template.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The template created.
      • newTemplate

        public static IlrTemplate newTemplate(IlrSession session)
        Creates a template.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The template created.
      • createRuleflow

        public static IlrRuleflow createRuleflow(IlrSession session)
        Deprecated. Use #newRuleflow(IlrSession) instead.
        Creates a ruleflow.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The ruleflow created.
      • newRuleflow

        public static IlrRuleflow newRuleflow(IlrSession session)
        Creates a ruleflow.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The ruleflow created.
      • createParameter

        public static IlrParameter createParameter(IlrSession session)
        Deprecated. Use #newParameter(IlrSession) instead.
        Creates a parameter.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The parameter created.
      • newParameter

        public static IlrParameter newParameter(IlrSession session)
        Creates a parameter.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The parameter created.
      • createBOM2XOMMapping

        public static IlrBOM2XOMMapping createBOM2XOMMapping(IlrSession session)
        Deprecated. Use #newBOM2XOMMapping(IlrSession) instead.
        Creates a bom2xommapping.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The bom2xommapping created.
      • newBOM2XOMMapping

        public static IlrBOM2XOMMapping newBOM2XOMMapping(IlrSession session)
        Creates a bom2xommapping.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The bom2xommapping created.
      • createTechnicalrule

        public static IlrTechnicalRule createTechnicalrule(IlrSession session)
        Deprecated. Use #newTechnicalrule(IlrSession) instead.
        Creates a technical rule.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The technical rule created.
      • newTechnicalrule

        public static IlrTechnicalRule newTechnicalrule(IlrSession session)
        Creates a technical rule.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The technical rule created.
      • createVariable

        public static IlrVariable createVariable(IlrSession session)
        Deprecated. Use #newVariable(IlrSession) instead.
        Creates a variable.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The variable created.
      • newVariable

        public static IlrVariable newVariable(IlrSession session)
        Creates a variable.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The variable created.
      • newVariable

        public static IlrVariable newVariable(IlrSession session,
                              java.lang.String name,
                              java.lang.String bomType,
                              java.lang.String verbalization,
                              java.lang.String initialValue)
        Creates a variable.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        name - The name of the variable.
        bomType - The BOM type of the variable.
        verbalization - The verbalization of the variable. Can be null.
        initialValue - An IRL expression defining an initial value for this variable.
        Returns:
        The variable created.
      • createVariableSet

        public static IlrVariableSet createVariableSet(IlrSession session)
        Deprecated. Use #newVariableSet(IlrSession) instead.
        Creates a variable set.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The variable set created.
      • newVariableSet

        public static IlrVariableSet newVariableSet(IlrSession session)
        Creates a variable set.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The variable set created.
      • createView

        public static IlrSmartView createView(IlrSession session)
        Deprecated. Use #newSmartView(IlrSession) instead.
        Creates a smart view.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The smart view created.
      • newSmartView

        public static IlrSmartView newSmartView(IlrSession session)
        Creates a smart view.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The smart view created.
      • createSmartView

        public static IlrSmartView createSmartView(IlrSession session,
                                   java.lang.String name,
                                   java.lang.String query,
                                   org.eclipse.emf.ecore.EStructuralFeature[] propertyPath)
                                            throws IlrApplicationException
        Creates a smart view and commits it in the working baseline.
        Throws:
        IlrApplicationException
        Parameters:
        session - The session that will be used to create the element.
        name - The name to give to the smart view.
        query - The BQL query to filter out elements to be displayed by the smart view.
        propertyPath - An ordered array of features that will be followed when displaying the smart view.
        Returns:
        The created smart view.
      • createFunction

        public static IlrFunction createFunction(IlrSession session)
        Deprecated. Use #newFunction(IlrSession) instead.
        Creates a function.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The function created.
      • newFunction

        public static IlrFunction newFunction(IlrSession session)
        Creates a function.

        This simply creates a new object, but does not commit it in the database.

        Parameters:
        session - The session.
        Returns:
        The function created.
      • createFunction

        public static IlrFunction createFunction(IlrSession session,
                                 IlrRulePackage rulePackage,
                                 java.lang.String name,
                                 java.lang.String returnType,
                                 java.lang.String[] argNames,
                                 java.lang.String[] argTypes,
                                 java.lang.String body,
                                 java.lang.String[] imports)
                                          throws IlrApplicationException
        Creates a function and commits it in the working baseline.
        Throws:
        IlrApplicationException
        Parameters:
        session - The session that will be used to create the element.
        rulePackage - The package in which this function must be created.
        name - The name to give to the function.
        returnType - The return type of the function.
        argNames - The names of the function arguments.
        argTypes - The types of the function arguments.
        body - The IRL body of the function.
        imports - The list of import statements of the function. They must be of the form "import my.example.*;".
        Returns:
        The committed function.
      • createVariableSet

        public static IlrVariableSet createVariableSet(IlrSession session,
                                       IlrRulePackage rulePackage,
                                       java.lang.String name,
                                       IlrVariable[] variables)
                                                throws IlrApplicationException
        Creates a variable set and commits it in the working baseline.

        Throws:
        IlrApplicationException
        Parameters:
        session - The session that will be used to create the element.
        rulePackage - The package in which this variable set must be created.
        name - The name to give to the variable set.
        variables - The list of variables to add in this variable set.
        Returns:
        The created variable set.
      • createRule

        public static IlrRule createRule(IlrSession session,
                         org.eclipse.emf.ecore.EClass eclass,
                         IlrRulePackage rulePackage,
                         java.lang.String name,
                         java.lang.String body)
                                  throws IlrApplicationException
        Create a rule and commit it in the working baseline.

        Throws:
        IlrApplicationException
        Parameters:
        session - The session that will be used to create the element.
        eclass - The EMF class of the rule to create. This must be a subclass of brm.Rule.
        rulePackage - The package in which this rule must be created.
        name - The name to give to the rule.
        body - The body of the rule. This will be some text of the "if...then" form if the rule is a BRL rule, some XML text if the rule is a decision table or a decision tree, or IRL code of the "when {...} then {...}" form if the rule is a technical rule.
        Returns:
        The created rule.
      • createRulePackage

        public static IlrRulePackage createRulePackage(IlrSession session,
                                       IlrRulePackage parent,
                                       java.lang.String name)
                                                throws IlrApplicationException
        Creates a rule and commits it in the working baseline.

        Throws:
        IlrApplicationException
        Parameters:
        session - The session that will be used to create the element.
        parent - The parent package in which this rule package must be created.
        name - The name to give to the rule.
        Returns:
        The created rule package.
      • createParameter

        public static IlrParameter createParameter(IlrSession session,
                                   java.lang.String name,
                                   java.lang.String bomType,
                                   int direction,
                                   java.lang.String initialValue)
                                            throws IlrApplicationException
        Creates a parameter for the working project and commits it in the working baseline.

        Throws:
        IlrApplicationException
        Parameters:
        session - The session that will be used to create the element.
        name - The name of the parameter.
        bomType - The fully qualified name of the BOM type of the parameter.
        direction - The direction of the parameter. One of:
        • IlrDirectionKind.IN
        • IlrDirectionKind.OUT
        • IlrDirectionKind.INOUT
        initialValue - An IRL expression defining an initial value for this parameter.
        Returns:
        The committed parameter.
      • getDetailsURL

        public static java.lang.String getDetailsURL(IlrSession session,
                                     java.lang.String contextPath,
                                     java.lang.String datasource,
                                     IlrElementHandle handle)
        Deprecated. Use IlrPermanentLinkHelper instead.
        Gets a URL that displays the Details page of the given element.

        If you try to open the generated URL in a browser and you are not yet logged in to Decision Center, you will first be asked to log in and then the page will be displayed.

        Parameters:
        session - The current session.
        contextPath - The context path that will be prepended to the generated URL. For instance, this could be "/teamserver" or "http://localhost:7001/teamserver" depending on the context from which you are calling this method (that is, from a JSP page, or from a standalone Java application).
        datasource - The name of the data source. If null, jdbc/ilogDataSource will be used.
        handle - Handle on the element from which you want to display the details.
        Returns:
        The URL of the element details with the context path prepended.
      • getDetailsURL

        public static java.lang.String getDetailsURL(IlrSession session,
                                     IlrElementHandle handle)
        Deprecated. Use IlrSessionHelper#getDetailsURL() instead.
        Gets a URL that displays the Details page of the given element.

        The context and the data source name are loaded from the session.

        NOTE: This methods will only return a valid result when called from the Decision Center web application. Calling this method from a remote client code might give unexpected results.

        Parameters:
        session - The current session.
        handle - Handle on the element from which you want to display the details.
        Returns:
        The URL of the element details.
      • getPath

        public static java.lang.String[] getPath(IlrElementHandle handle,
                                 java.lang.String projectName)
        Deprecated. Use #getPath(session, handle, baseline) instead
        Gets the path of the given element handle & project name.

        Parameters:
        handle - The element handle.
        projectName - The project name.
        Returns:
        The path.
      • getPath

        public static java.lang.String[] getPath(IlrSession session,
                                 IlrElementHandle handle,
                                 IlrBaseline baseline)
                                          throws IlrObjectNotFoundException
        Gets the path of the given element handle & project name.

        Throws:
        IlrObjectNotFoundException - if an object is not found while comnputing the path.
        Parameters:
        handle - The element handle.
        baseline - The baseline in which the element path must be computed. If null, the working baseline of the session.
        session - The session to use.
        Returns:
        An array of strings representing the path.
      • computeDependentBaselines

        public static java.util.List<IlrBaseline> computeDependentBaselines(IlrSession session,
                                                            IlrBaseline baseline)
                                                                     throws IlrObjectNotFoundException
        Computes the baselines used by the given source baseline.

        Throws:
        IlrObjectNotFoundException - If the source baseline cannot be found.
        Parameters:
        session - The session to use to make the computation.
        baseline - The baseline for which you want to compute the dependencies.
        Returns:
        A list of IlrBaseline objects.
      • copyTo

        public static IlrPackageElement copyTo(IlrSession session,
                               IlrPackageElement packageElement,
                               IlrRulePackage rulePackage)
                                        throws IlrApplicationException
        Deprecated. Use IlrSession.copyTo instead
        Copies a package element (rule, template, folder, and so on) to the given rule package.

        If the element to copy is a rule package, all of its content will be copied. If the target rule package is the same as the parent of the package element to copy, the copied element name will be prefixed in order to avoid conflicts. The default prefix is "Copy of", but can be redefined or localized through the duplicatePrefix_key key in the ilog.rules.teamserver.common.i18n.messages bundle.

        Throws:
        IlrApplicationException - If an error occurs, in which case the whole operation is cancelled.
        Parameters:
        session - The session to use in order to perform the operation.
        packageElement - The package element to copy.
        rulePackage - The rule package where the package element will be copied. Null if you wish to copy the element at the top level.
        Returns:
        The handle on the new copied element.
      • dtControllerToStorableString

        public static java.lang.String dtControllerToStorableString(IlrSession session,
                                                    ilog.rules.dt.IlrDTController controller)
        Gets an XML string representing the given DT controller, ready to store in Decision Center.

        This string can be used directly to set the body property of the decision table and decision tree objects.

        Note: If the controller locale is different from the Decision Center persistence locale, the controller will be converted and the generated XML string will be represented using the persistence locale.

        Parameters:
        session - The session to use in order to perform the operation.
        controller - The DT controller.
        Returns:
        An XML string representing the DT model.
      • getDTController

        public static ilog.rules.dt.IlrDTController getDTController(IlrSession session,
                                                    IlrDecisionTree dtree,
                                                    java.util.Locale locale)
                                                             throws IlrObjectNotFoundException
        Extracts a DT controller from the given decision tree.

        Throws:
        IlrObjectNotFoundException - If the given handle references an element that cannot be found in the repository.
        Parameters:
        session - The session to use in order to perform the operation.
        dtree - The decision tree.
        locale - The locale to use for this controller. If the requested locale is different from the Decision Center persistence locale and if a vocabulary exists for this requested locale, the returned controller will be converted to this requested locale.
        Returns:
        The DT controller corresponding to the body of the given decision tree.
      • getDTController

        public static ilog.rules.dt.IlrDTController getDTController(IlrSession session,
                                                    IlrDecisionTable dtable,
                                                    java.util.Locale locale)
                                                             throws IlrObjectNotFoundException
        Extracts a DT controller from the given decision table.

        Throws:
        IlrObjectNotFoundException - If the given handle references an element that cannot be found in the repository.
        Parameters:
        session - The session to use in order to perform the operation.
        dtable - The decision table.
        locale - The locale to use for this controller. If the requested locale is different from the Decision Center persistence locale and if a vocabulary exists for this requested locale, the returned controller will be converted to this requested locale.
        Returns:
        The DT controller corresponding to the body of the given decision table.
      • getDTController

        public static ilog.rules.dt.IlrDTController getDTController(IlrSession session,
                                                    IlrElementHandle handle,
                                                    java.lang.String body,
                                                    java.util.Locale locale)
                                                             throws IlrObjectNotFoundException
        Extracts a DT controller from the given decision table or decision tree.

        This string typically comes from the body property of a decision table or decision tree object.

        Throws:
        IlrObjectNotFoundException - If the given handle references an element that cannot be found in the repository.
        Parameters:
        session - The session to use in order to perform the operation.
        handle - Handle on the decision tree or table.
        body - The XML string that represents the DT. If null, the body is retrieved from the repository, if this element already exists in the repository.
        locale - The locale to use for this controller. If the requested locale is different from the Decision Center persistence locale and if a vocabulary exists for this requested locale, the returned controller will be converted to this requested locale.
        Returns:
        The DT controller corresponding to the body of the given handle.
      • getDTController

        public static ilog.rules.dt.IlrDTController getDTController(IlrSession session,
                                                    IlrElementHandle handle,
                                                    IlrElementVersion elementVersion,
                                                    java.lang.String body,
                                                    java.util.Locale locale)
                                                             throws IlrObjectNotFoundException
        Extracts a DT controller from the given decision table or decision tree.

        This string typically comes from the body property of a decision table or decision tree object.

        Throws:
        IlrObjectNotFoundException - If the given handle references an element that cannot be found in the repository.
        Parameters:
        session - The session to use in order to perform the operation.
        handle - Handle on the decision tree or table.
        elementVersion - Version to retrieve for given element handle.
        body - The XML string that represents the DT. If null, the body is retrieved from the repository, if this element already exists in the repository.
        locale - The locale to use for this controller. If the requested locale is different from the Decision Center persistence locale and if a vocabulary exists for this requested locale, the returned controller will be converted to this requested locale.
        Returns:
        The DT controller corresponding to the body of the given handle.
      • getSyntaxTree

        public static ilog.rules.brl.syntaxtree.IlrSyntaxTree getSyntaxTree(IlrSession session,
                                                            IlrElementHandle handle,
                                                            IlrElementVersion elementVersion,
                                                            java.lang.String body,
                                                            java.util.Locale locale)
                                                                     throws IlrObjectNotFoundException
        Extracts a syntax tree from the given BRL rule.

        This string typically comes from the body property of BRL rule object.

        Throws:
        IlrObjectNotFoundException - If the given handle references an element that cannot be found in the repository.
        Parameters:
        session - The session to use in order to perform the operation.
        handle - Handle on the BRL Rule.
        elementVersion - Version to retrieve for given element handle.
        body - The body of the rule. If null, the body is retrieved from the repository, if this element already exists in the repository.
        locale - The locale to use for this rule. If the requested locale is different from the Decision Center persistence locale and if a vocabulary exists for this requested locale, the returned syntax tree will be converted to this requested locale.
        Returns:
        The syntax tree corresponding to the body of the given handle.
      • getSyntaxTree

        public static ilog.rules.brl.syntaxtree.IlrSyntaxTree getSyntaxTree(IlrSession session,
                                                            IlrBRLRule rule,
                                                            java.util.Locale locale)
                                                                     throws IlrObjectNotFoundException
        Extracts a syntax tree from the given BRL Rule.

        Throws:
        IlrObjectNotFoundException - If the given handle references an element that cannot be found in the repository.
        Parameters:
        session - The session to use in order to perform the operation.
        rule - The BRL Rule.
        locale - The locale to use for this syntax tree. If the requested locale is different from the Decision Center persistence locale and if a vocabulary exists for this requested locale, the returned syntax tree will be converted to this requested locale.
        Returns:
        The syntax tree corresponding to the body of the given rule.
      • getSyntaxTree

        public static ilog.rules.brl.syntaxtree.IlrSyntaxTree getSyntaxTree(IlrSession session,
                                                            IlrElementHandle handle,
                                                            java.lang.String body,
                                                            java.util.Locale locale)
                                                                     throws IlrObjectNotFoundException
        Extracts a syntax tree from the given BRL Rule.

        This string typically comes from the body property of a BRL Rule object.

        Throws:
        IlrObjectNotFoundException - If the given handle references an element that cannot be found in the repository.
        Parameters:
        session - The session to use in order to perform the operation.
        handle - Handle on the BRL rule.
        body - The body of the rule. If null, the body is retrieved from the repository, if this element already exists in the repository.
        locale - The locale to use for this syntax tree. If the requested locale is different from the Decision Center persistence locale and if a vocabulary exists for this requested locale, the returned syntax tree will be converted to this requested locale.
        Returns:
        The syntax tree corresponding to the body of the given handle.
      • getRuleflowImage

        public static byte[] getRuleflowImage(IlrRuleflow ruleflow)
        Generates the ruleflow image from a given ruleflow

        Parameters:
        ruleflow - The ruleflow to generate the image from.
        Returns:
        A byte array containing the ruleflow image in PNG format.
      • getDecisionTreeImage

        public static byte[] getDecisionTreeImage(IlrDecisionTree decisionTree)
        Generates the decision tree image from a given decision tree.

        Parameters:
        decisionTree - The decision tree to generate the image from.
        Returns:
        A byte array containing the decision tree image in PNG format.
      • publishProject

        public static java.lang.String publishProject(IlrSession session,
                                      java.io.File workspaceDir,
                                      boolean override,
                                      java.lang.String projectName,
                                      java.lang.String url,
                                      java.lang.String userName,
                                      java.lang.String password,
                                      java.lang.String datasource)
        Publishes a project from the workspace to Decision Center

        Parameters:
        session - The session to use.
        workspaceDir - The path to the workspace directory.
        override - Can be specified in order to override changes in case the project is already in the repository.
        projectName - The name of the project to publish. Can be null if you want to publish all the projects from the workspace.
        url - The url of the server to use for synchronization
        userName - The username used by synchronization
        password - The password for the username provided
        datasource - The datasource to use. Can be null if this is the default datasource
        Returns:
        The name of the last project published if any
      • importProject

        public static void importProject(IlrSession session,
                         java.io.File workspaceDir,
                         boolean override,
                         java.lang.String url,
                         java.lang.String userName,
                         java.lang.String password,
                         java.lang.String datasource)
        Imports the current project from Decision Center into the workspace.

        Parameters:
        session - The session to use.
        workspaceDir - The path to the workspace directory.
        override - Can be specified in order to override changes in case the project is already in the workspace.
        url - The url of the server to use for synchronization
        userName - The username used by synchronization
        password - The password for the username provided
        datasource - The datasource to use. Can be null if this is the default datasource
      • importProject

        public static void importProject(IlrSession session,
                         java.io.File workspaceDir,
                         boolean override,
                         java.lang.String url,
                         java.lang.String userName,
                         java.lang.String password,
                         java.lang.String datasource,
                         java.lang.String branch)
        Imports the current project from Decision Center into the workspace.

        Parameters:
        session - The session to use.
        workspaceDir - The path to the workspace directory.
        override - Can be specified in order to override changes in case the project is already in the workspace.
        url - The url of the server to use for synchronization
        userName - The username used by synchronization
        password - The password for the username provided
        datasource - The datasource to use. Can be null if this is the default datasource
        branch - The branch name of given project to import.
      • computeAccessibleDependentBaselines

        public static java.util.List<IlrBaseline> computeAccessibleDependentBaselines(IlrSession session,
                                                                      IlrBaseline baseline)
                                                                               throws IlrApplicationException
        Computes the accessible baselines used by the given source baseline.

        Throws:
        IlrApplicationException
        Parameters:
        session - The session to use to make the computation.
        baseline - The baseline for which you want to compute the dependencies.
        Returns:
        A list of IlrBaseline objects.
      • createDecisionServiceProject

        public static IlrRuleProject createDecisionServiceProject(IlrSession session,
                                                  java.lang.String mainProjectName,
                                                  java.lang.String... dependencies)
                                                           throws IlrApplicationException
        Creates and sets up a decision service with the given name.

        By default a project is set up to contain:

        • A Business Rules view
        • A Templates view
        • A Ruleflows view
        • An empty rule template for each subtype of brm.BRLRule
        Also, the category list of the project is set to { any }.
        Throws:
        IlrApplicationException - If an error happens when creating the project.
        Parameters:
        session - The session to use to perform the operation.
        mainProjectName - The name of the main project to create.
        one - or more project name to add as dependency(ies) of the decision service
        Returns:
        The created project.
      • createDecisionServiceProject

        public static IlrRuleProject createDecisionServiceProject(IlrSession session,
                                                  java.lang.String mainProjectName,
                                                  java.lang.String engineKind,
                                                  java.lang.String... dependencies)
                                                           throws IlrApplicationException
        Creates and sets up a decision service with the given name.

        By default a project is set up to contain:

        • A Business Rules view
        • A Templates view
        • A Ruleflows view
        • An empty rule template for each subtype of brm.BRLRule
        Also, the category list of the project is set to { any }.
        Throws:
        IlrApplicationException - If an error happens when creating the project.
        Parameters:
        session - The session to use to perform the operation.
        mainProjectName - The name of the main project to create.
        engineKind - the engine kind for this decision service. DecisionEngine for decision engine, null for Classic Rule Engine
        one - or more project name to add as dependency(ies) of the decision service
        Returns:
        The created project.
      • createDecisionServiceProject

        public static IlrRuleProject createDecisionServiceProject(IlrSession session,
                                                  java.lang.String mainProjectName,
                                                  IlrDependency... dependencies)
                                                           throws IlrApplicationException
        Creates and sets up a decision service with the given name.

        By default a project is set up to contain:

        • A Business Rules view
        • A Templates view
        • A Ruleflows view
        • An empty rule template for each subtype of brm.BRLRule
        Also, the category list of the project is set to { any }.
        Throws:
        IlrApplicationException - If an error happens when creating the project.
        Parameters:
        session - The session to use to perform the operation.
        mainProjectName - The name of the main project to create.
        one - or more to add as dependency(ies) of the decision service
        Returns:
        The created project.
      • createDecisionServiceProject

        public static IlrRuleProject createDecisionServiceProject(IlrSession session,
                                                  java.lang.String mainProjectName,
                                                  java.lang.String engineKind,
                                                  IlrDependency... dependencies)
                                                           throws IlrApplicationException
        Creates and sets up a decision service with the given name.

        By default a project is set up to contain:

        • A Business Rules view
        • A Templates view
        • A Ruleflows view
        • An empty rule template for each subtype of brm.BRLRule
        Also, the category list of the project is set to { any }.
        Throws:
        IlrApplicationException - If an error happens when creating the project.
        Parameters:
        session - The session to use to perform the operation.
        mainProjectName - The name of the main project to create.
        engineKind - the engine kind for this decision service. DecisionEngine for decision engine, null for Classic Rule Engine
        one - or more to add as dependency(ies) of the decision service
        Returns:
        The created project.
      • createStandardRuleProject

        public static IlrRuleProject createStandardRuleProject(IlrSession session,
                                               java.lang.String name,
                                               java.lang.String engineKind,
                                               java.lang.String... dependencies)
                                                        throws IlrApplicationException
        Creates and sets up a standard rule project with the given name. A standard rule project must be referenced by a main rule project so that it is included in a decision service.

        By default a project is set up to contain:

        • A Business Rules view
        • A Templates view
        • A Ruleflows view
        • An empty rule template for each subtype of brm.BRLRule
        Also, the category list of the project is set to { any }.
        Throws:
        IlrApplicationException - If an error happens when creating the project.
        Parameters:
        session - The session to use to perform the operation.
        name - The name of the project to create.
        engineKind - the engine kind for this decision service. DecisionEngine for decision engine, null for Classic Rule Engine
        one - or more project name to add as dependency(ies) of the decision service
        Returns:
        The created project.
      • createStandardRuleProject

        public static IlrRuleProject createStandardRuleProject(IlrSession session,
                                               java.lang.String name,
                                               java.lang.String engineKind)
                                                        throws IlrApplicationException
        Creates and sets up a standard rule project with the given name. A standard rule project must be referenced by a main rule project so that it is included in a decision service.

        By default a project is set up to contain:

        • A Business Rules view
        • A Templates view
        • A Ruleflows view
        • An empty rule template for each subtype of brm.BRLRule
        Also, the category list of the project is set to { any }.
        Throws:
        IlrApplicationException - If an error happens when creating the project.
        Parameters:
        session - The session to use to perform the operation.
        name - The name of the project to create.
        engineKind - the engine kind for this decision service. DecisionEngine for decision engine, null for Classic Rule Engine
        Returns:
        The created project.
      • createStandardRuleProject

        public static IlrRuleProject createStandardRuleProject(IlrSession session,
                                               java.lang.String name,
                                               boolean createBomEntry,
                                               IlrDependency... dependencies)
                                                        throws IlrApplicationException
        Creates and sets up a standard rule project with the given name. A standard rule project must be referenced by a main rule project so that it is included in a decision service.

        By default a project is set up to contain:

        • A Business Rules view
        • A Templates view
        • A Ruleflows view
        • An empty rule template for each subtype of brm.BRLRule
        Also, the category list of the project is set to { any }.
        Throws:
        IlrApplicationException - If an error happens when creating the project.
        Parameters:
        session - The session to use to perform the operation.
        name - The name of the project to create.
        createBomEntry - true to create the BOM Entry
        one - or more to add as dependency(ies) of the decision service
        Returns:
        The created project.
      • newDependency

        public static IlrDependency newDependency(IlrSession session,
                                  java.lang.String projectName,
                                  java.lang.String branchName,
                                  boolean createBomPath)
                                           throws IlrApplicationException
        Creates a dependency with the given project name and the given branch name
        Throws:
        IlrApplicationException - If something wrong happens during the operation
        Parameters:
        session - The session to use to perform the operation.
        projectName - the requested project name.
        branchName - The requested branch name.
        createBomPath - create of not the bom path
        Returns:
        A dependency.
      • freezeProject

        public static void freezeProject(IlrSession session,
                         IlrRuleProject project,
                         java.lang.String message)
                                  throws IlrApplicationException
        Freezes a project so that it cannot be modified by any user. All the branches of the project and the projects that it depends on will be locked to prevent modifications. When a user tries to open the project in the Enterprise Console, a message will be displayed. The project can still be explored but is read-only. The project can by "unfrozen" by calling unfreezeProject(IlrSession, IlrRuleProject).
        Throws:
        IlrApplicationException
        Parameters:
        session - The Decision Center session.
        project - The project to freeze.
        message - An optional message to display when a user opens the project in the console. If this argument is null, a default message will be used. The message can be a localization key, in which case the localized message will be looked up in the "ilog.rules.teamserver.common.messages" bundle.
        See Also:
        unfreezeProject(IlrSession, IlrRuleProject)

© Copyright IBM Corp. 1987, 2020