Decision Center API

ilog.rules.teamserver.model
Class IlrSessionHelper

java.lang.Object
  extended by ilog.rules.teamserver.model.IlrSessionHelper
All Implemented Interfaces:
IlrModelConstants

public class IlrSessionHelper
extends Object
implements IlrModelConstants

IlrSessionHelper contains a set of helper methods that you use to manipulate Decision Center services and data.

Code example

The following code example shows how to connect to the Decision Center and run a query on the server from a client Java application:

   String serverUrl = "http://localhost:9080/teamserver";
   String datasource = "jdbc/ilogDataSource";
   String login = "rtsAdmin";
   String password = "rtsAdmin";
   String project = "loanvalidation-rules";

   IlrSessionFactory factory = new IlrRemoteSessionFactory();
   try {
     factory.connect(login, password, serverUrl, datasource);
     IlrSession session = factory.getSession();

     // get the project by name
     IlrRuleProject ruleProject = (IlrRuleProject) IlrSessionHelper.getProjectNamed(session, project);
     // open current baseline
     IlrBaseline currentBaseline = IlrSessionHelper.getCurrentBaseline(session, ruleProject);
     session.setWorkingBaseline(currentBaseline);
     String query = new String("Find all business rules such that "
                                        + "the last modification date of each "
                                        + "business rule is after 10/27/05 2:55:25 PM");
     IlrDefaultSearchCriteria criteria = new IlrDefaultSearchCriteria(
                                        query.toString());
     List summaries = session.findElements(criteria, IlrModelConstants.ELEMENT_SUMMARY);

     for (int i = 0; i < summaries.size(); i++) {
       IlrElementSummary ruleSummary = (IlrElementSummary) summaries.get(i);
       String ruleName = ruleSummary.getName();
       System.out.println("\t" + ruleName);
     }
     session.close();
   }
   catch (IlrConnectException cE)
   {
     cE.printStackTrace();
   }
 
When you set the name of rule project items, you should use the Java naming conventions. However, as an exception, you can use spaces because they are processed into valid characters when you execute, but do not use spaces at the beginning of a name.


Field Summary
 
Fields inherited from interface ilog.rules.teamserver.model.IlrModelConstants
CURRENT_BASELINE_NAME, DEFAULT_EXTRACTORVALIDATOR, DEFAULT_SCOPE, DEFAULT_SSPRESOLVER, ELEMENT_COMMITABLE_OBJECT, ELEMENT_DETAILS, ELEMENT_HANDLE, ELEMENT_SUMMARY, RECYCLEBIN_BASELINE, SCOPE_PROJECT, SCOPE_PROJECT_AND_DEPENDENCIES
 
Constructor Summary
IlrSessionHelper()
           
 
Method Summary
static List<IlrElementError> checkElement(IlrSession session, IlrBaseline baseline, IlrElementHandle element)
          Checks a given element for errors.
static List<IlrBaseline> computeDependentBaselines(IlrSession session, IlrBaseline baseline)
          Computes the baselines used by the given source baseline.
static IlrElementHandle copyElementFromSourceBaselineToTargetBranch(IlrSession session, IlrBaseline source, IlrElementHandle element, IlrBaseline targetBranch)
           
static IlrElementHandle copyElementFromWorkingBaselineToBranch(IlrSession session, IlrElementHandle element, IlrBaseline targetBranch)
           
static IlrPackageElement copyTo(IlrSession session, IlrPackageElement packageElement, IlrRulePackage rulePackage)
          Deprecated. Use IlrSession.copyTo instead
static IlrActionRule createActionRule(IlrSession session)
          Deprecated. Use newActionRule(IlrSession) instead.
static IlrActionRule createActionRule(IlrSession session, IlrRulePackage rulePackage, String name, String body)
          Creates an action rule and commits it in the working baseline.
static IlrBOM createBOM(IlrSession session)
          Deprecated. Use #newBOM(IlrSession) instead.
static IlrBOM createBOM(IlrSession session, String name, String body)
          Creates a BOM with the given name and body.
static IlrBOM createBOM(IlrSession session, String name, String body, boolean createBOMEntry)
          Creates a BOM with the given name and body.
static IlrBOM2XOMMapping createBOM2XOMMapping(IlrSession session)
          Deprecated. Use #newBOM2XOMMapping(IlrSession) instead.
static IlrBOM2XOMMapping createBOM2XOMMapping(IlrSession session, String name, String body)
          Creates a B2X with the given name and body.
static void createDependency(IlrSession session, IlrRuleProject src, IlrRuleProject dest, boolean createProjectBOMEntry)
          Creates a dependency between the given projects, for their current baselines.
static IlrRuleProject createEventProject(IlrSession session, String name)
          Creates and sets up an event project with the given name.
static IlrExtractor createExtractor(IlrSession session)
          Deprecated. Use #newExtractor(IlrSession) instead.
static IlrCommitableObject createFromTemplate(IlrSession session, IlrTemplate template)
          Instantiates a rule from the given template.
static IlrFunction createFunction(IlrSession session)
          Deprecated. Use #newFunction(IlrSession) instead.
static IlrFunction createFunction(IlrSession session, IlrRulePackage rulePackage, String name, String returnType, String[] argNames, String[] argTypes, String body, String[] imports)
          Creates a function and commits it in the working baseline.
static IlrParameter createParameter(IlrSession session)
          Deprecated. Use #newParameter(IlrSession) instead.
static IlrParameter createParameter(IlrSession session, String name, String bomType, int direction, String initialValue)
          Creates a parameter for the working project and commits it in the working baseline.
static IlrElementHandle createProject(IlrSession session, String name)
          Deprecated. Use createRuleProject() instead.
static IlrQuery createQuery(IlrSession session)
          Deprecated. Use #newQuery(IlrSession) instead.
static IlrRule createRule(IlrSession session, org.eclipse.emf.ecore.EClass eclass, IlrRulePackage rulePackage, String name, String body)
          Create a rule and commit it in the working baseline.
static IlrRuleflow createRuleflow(IlrSession session)
          Deprecated. Use #newRuleflow(IlrSession) instead.
static IlrRulePackage createRulePackage(IlrSession session)
          Deprecated. Use #newRulePackage(IlrSession) instead.
static IlrRulePackage createRulePackage(IlrSession session, IlrRulePackage parent, String name)
          Creates a rule and commits it in the working baseline.
static IlrRuleProject createRuleProject(IlrSession session, String name)
          Creates and sets up a project with the given name.
static IlrRuleProject createRuleProject(IlrSession session, String name, String platform)
          Deprecated. Replaced by createRuleProject(IlrSession, String) and createEventProject(IlrSession, String)
static IlrSmartView createSmartView(IlrSession session, String name, String query, org.eclipse.emf.ecore.EStructuralFeature[] propertyPath)
          Creates a smart view and commits it in the working baseline.
static IlrTag createTag(IlrSession session)
          Deprecated. Use #newTag(IlrSession) instead.
static IlrTechnicalRule createTechnicalrule(IlrSession session)
          Deprecated. Use #newTechnicalrule(IlrSession) instead.
static IlrTechnicalRule createTechnicalRule(IlrSession session, IlrRulePackage rulePackage, String name, String body)
          Creates a technical rule and commits it in the working baseline.
static IlrTemplate createTemplate(IlrSession session)
          Deprecated. Use #newTemplate(IlrSession) instead.
static IlrVariable createVariable(IlrSession session)
          Deprecated. Use #newVariable(IlrSession) instead.
static IlrVariableSet createVariableSet(IlrSession session)
          Deprecated. Use #newVariableSet(IlrSession) instead.
static IlrVariableSet createVariableSet(IlrSession session, IlrRulePackage rulePackage, String name, IlrVariable[] variables)
          Creates a variable set and commits it in the working baseline.
static IlrSmartView createView(IlrSession session)
          Deprecated. Use #newSmartView(IlrSession) instead.
static IlrVocabulary createVocabulary(IlrSession session)
          Deprecated. Use #newVocabulary(IlrSession) instead.
static IlrVocabulary createVocabulary(IlrSession session, String name, String body, Locale locale)
          Creates a vocabulary with the given name and body.
static String dtControllerToStorableString(IlrSession session, ilog.rules.dt.IlrDTController controller)
          Gets an XML string representing the given DT controller, ready to store in Decision Center.
static IlrBaseline getBaselineNamed(IlrSession session, IlrBaseline parentBaseline, String name)
           
static IlrBaseline getBaselineNamed(IlrSession session, IlrElementHandle project, String name)
          Gets the baseline with the given name, for the given project.
static List<IlrBaseline> getBaselines(IlrSession session, IlrRuleProject project)
          Gets the baselines associated with the given project.
static IlrBranch getCurrentBaseline(IlrSession session, IlrElementHandle project)
          Gets the current baseline for the given project.
static byte[] getDecisionTreeImage(IlrDecisionTree decisionTree)
          Generates the decision tree image from a given decision tree.
static List<IlrBaseline> getDeployedBaselines(IlrSession session, IlrElementHandle ruleAppHandle)
          Returns the list of deployment baselines that were created using this RuleApp.
static List<String> getDeployedBaselinesNames(IlrSession session, IlrElementHandle ruleAppHandle)
          Returns the list of deployment baselines names that were created using this RuleApp.
static IlrBaseline getDeploymentBaselineNamed(IlrSession session, IlrBaseline parentBranch, String name, IlrRuleset ruleset)
           
static String getDetailsURL(IlrSession session, IlrElementHandle handle)
          Deprecated. Use IlrSessionHelper#getDetailsURL() instead.
static String getDetailsURL(IlrSession session, String contextPath, String datasource, IlrElementHandle handle)
          Deprecated. Use IlrPermanentLinkHelper instead.
static ilog.rules.dt.IlrDTController getDTController(IlrSession session, IlrDecisionTable dtable, Locale locale)
          Extracts a DT controller from the given decision table.
static ilog.rules.dt.IlrDTController getDTController(IlrSession session, IlrDecisionTree dtree, Locale locale)
          Extracts a DT controller from the given decision tree.
static ilog.rules.dt.IlrDTController getDTController(IlrSession session, IlrElementHandle handle, IlrElementVersion elementVersion, String body, Locale locale)
          Extracts a DT controller from the given decision table or decision tree.
static ilog.rules.dt.IlrDTController getDTController(IlrSession session, IlrElementHandle handle, String body, Locale locale)
          Extracts a DT controller from the given decision table or decision tree.
static IlrElementDetails getElementFromPath(IlrSession session, String path)
          Gets the project element corresponding to the given path.
static IlrElementDetails getElementFromPath(IlrSession session, String path, IlrPackageKind packageKind)
          Gets the project element corresponding to the given path.
static List getElementsFromPath(IlrSession session, String path)
          Gets the project elements corresponding to the given path.
static List getElementsFromPath(IlrSession session, String path, IlrPackageKind packageKind)
          Gets the project elements corresponding to the given path.
static String[] getPath(IlrElementHandle handle, String projectName)
          Deprecated. Use #getPath(session, handle, baseline) instead
static String[] getPath(IlrSession session, IlrElementHandle handle, IlrBaseline baseline)
          Gets the path of the given element handle & project name.
static IlrRuleProject getProjectNamed(IlrSession session, String name)
          Gets the project with the given name.
static List getProjects(IlrSession session)
          Gets all the projects contained in the repository ordered by project name.
static IlrBaseline getRecyclebinBaseline(IlrSession session)
           
static IlrBaseline getRecyclebinBaseline(IlrSession session, IlrElementHandle project)
          Gets the recycle bin baseline for the given project.
static IlrBaseline getRecyclebinBaseline(IlrSession session, IlrProjectElement projectElement)
           
static byte[] getRuleflowImage(IlrRuleflow ruleflow)
          Generates the ruleflow image from a given ruleflow
static ilog.rules.brl.syntaxtree.IlrSyntaxTree getSyntaxTree(IlrSession session, IlrBRLRule rule, Locale locale)
          Extracts a syntax tree from the given BRL Rule.
static ilog.rules.brl.syntaxtree.IlrSyntaxTree getSyntaxTree(IlrSession session, IlrElementHandle handle, IlrElementVersion elementVersion, String body, Locale locale)
          Extracts a syntax tree from the given BRL rule.
static ilog.rules.brl.syntaxtree.IlrSyntaxTree getSyntaxTree(IlrSession session, IlrElementHandle handle, String body, Locale locale)
          Extracts a syntax tree from the given BRL Rule.
static void importProject(IlrSession session, File workspaceDir, boolean override, String url, String userName, String password, String datasource)
          Imports the current project from Decision Center into the workspace.
static IlrSearchCriteria makeBuildCriteria(IlrSession session, IlrExtractor extractor)
          Builds a search criteria from the given extractor.
static IlrSearchCriteria makeBuildCriteria(IlrSession session, IlrQuery query)
          Builds a search criteria from the query.
static ilog.rules.brl.brldf.IlrBRLVariableProvider makeVariableProvider(IlrSession session)
          Deprecated. Use IlrSession#getWorkingVariableProvider() instead.
static IlrActionRule newActionRule(IlrSession session)
          Creates an action rule.
static IlrBOM newBOM(IlrSession session)
          Creates a BOM.
static IlrBOM2XOMMapping newBOM2XOMMapping(IlrSession session)
          Creates a bom2xommapping.
static IlrExtractor newExtractor(IlrSession session)
          Creates an extractor.
static IlrFunction newFunction(IlrSession session)
          Creates a function.
static IlrParameter newParameter(IlrSession session)
          Creates a parameter.
static IlrQuery newQuery(IlrSession session)
          Creates a query.
static IlrRuleflow newRuleflow(IlrSession session)
          Creates a ruleflow.
static IlrRulePackage newRulePackage(IlrSession session)
          Creates a rule package.
static IlrRulePackage newRulePackage(IlrSession session, IlrPackageKind packageKind)
          Creates a package.
static IlrSmartView newSmartView(IlrSession session)
          Creates a smart view.
static IlrTag newTag(IlrSession session)
          Creates a tag.
static IlrTechnicalRule newTechnicalrule(IlrSession session)
          Creates a technical rule.
static IlrTemplate newTemplate(IlrSession session)
          Creates a template.
static IlrVariable newVariable(IlrSession session)
          Creates a variable.
static IlrVariable newVariable(IlrSession session, String name, String bomType, String verbalization, String initialValue)
          Creates a variable.
static IlrVariableSet newVariableSet(IlrSession session)
          Creates a variable set.
static IlrVocabulary newVocabulary(IlrSession session)
          Creates a vocabulary.
static String publishProject(IlrSession session, File workspaceDir, boolean override, String projectName, String url, String userName, String password, String datasource)
          Publishes a project from the workspace to Decision Center
static void setBOMPath(IlrSession session, IlrBaseline baseline, List bomPathEntries)
          Sets the BOM path of the given baseline.
static void setDefinition(IlrSession session, IlrElementHandle ruleArtifact, String body)
          Sets the definition of the given rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlrSessionHelper

public IlrSessionHelper()
Method Detail

setDefinition

public static void setDefinition(IlrSession session,
                                 IlrElementHandle ruleArtifact,
                                 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 List 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,
                                             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,
                                             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:

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,
                                               String name)
                                        throws IlrApplicationException
Creates and sets up a project with the given name.

By default a project is set up to contain:

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,
                                                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:

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.

createRuleProject

public static IlrRuleProject createRuleProject(IlrSession session,
                                               String name,
                                               String platform)
                                        throws IlrApplicationException
Deprecated. Replaced by createRuleProject(IlrSession, String) and createEventProject(IlrSession, String)

Creates and sets up a project with the given name.

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

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.
platform - The platform of the project (.Net or Java).
Returns:
The created project.

getElementsFromPath

public static List getElementsFromPath(IlrSession session,
                                       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 List getElementsFromPath(IlrSession session,
                                       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,
                                                   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,
                                                   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,
                                                IlrElementHandle project)
                                         throws IlrObjectNotFoundException
Gets the recycle bin baseline for the given project.

Throws:
IlrObjectNotFoundException - If the project cannot be found.
Parameters:
session - The session to use to perform the operation.
project - Handle on the project.
Returns:
The recycle bin baseline.

getRecyclebinBaseline

public static IlrBaseline getRecyclebinBaseline(IlrSession session)
                                         throws IlrObjectNotFoundException
Throws:
IlrObjectNotFoundException

getRecyclebinBaseline

public static IlrBaseline getRecyclebinBaseline(IlrSession session,
                                                IlrProjectElement projectElement)
                                         throws IlrFolderLockedException,
                                                IlrInvalidElementException,
                                                IlrKnownUUIDException,
                                                IlrObjectLockedException,
                                                IlrObjectNotFoundException,
                                                IlrPermissionException
Throws:
IlrFolderLockedException
IlrInvalidElementException
IlrKnownUUIDException
IlrObjectLockedException
IlrObjectNotFoundException
IlrPermissionException

getCurrentBaseline

public static IlrBranch getCurrentBaseline(IlrSession session,
                                           IlrElementHandle project)
                                    throws IlrObjectNotFoundException
Gets the current baseline for the given project.

Throws:
IlrObjectNotFoundException - If the project cannot be found.
Parameters:
session - The session to use to perform the operation.
project - Handle on the project.
Returns:
The current baseline.

getBaselineNamed

public static IlrBaseline getBaselineNamed(IlrSession session,
                                           IlrElementHandle project,
                                           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.

getBaselineNamed

public static IlrBaseline getBaselineNamed(IlrSession session,
                                           IlrBaseline parentBaseline,
                                           String name)
                                    throws IlrObjectNotFoundException
Throws:
IlrObjectNotFoundException

getDeploymentBaselineNamed

public static IlrBaseline getDeploymentBaselineNamed(IlrSession session,
                                                     IlrBaseline parentBranch,
                                                     String name,
                                                     IlrRuleset ruleset)
                                              throws IlrObjectNotFoundException
Throws:
IlrObjectNotFoundException

getDeployedBaselines

public static 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 List<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,
                               String name,
                               String body)
                        throws IlrApplicationException
Creates a BOM with the given name and body.

Note that no BOM entry is created.

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 BOM.
See Also:
createBOM(IlrSession, String, String, boolean)

createBOM

public static IlrBOM createBOM(IlrSession session,
                               String name,
                               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,
                                                     String name,
                                                     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,
                                             String name,
                                             String body,
                                             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.

getBaselines

public static List<IlrBaseline> getBaselines(IlrSession session,
                                             IlrRuleProject project)
                                      throws IlrObjectNotFoundException
Gets the baselines associated with the given project.

Throws:
IlrObjectNotFoundException - If the project cannot be found in the database.
Parameters:
session - The session to use to perform the operation.
project - The requested name.
Returns:
A list of IlrBaseline objects.

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,
                                                  IlrExtractor extractor)
                                           throws IlrObjectNotFoundException
Builds a search criteria from the given extractor.

Throws:
IlrObjectNotFoundException - If the extractor cannot be found in the database.
Parameters:
session - The session.
extractor - The extractor to use.
Returns:
A search criteria.

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,
                              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,
                                      String name,
                                      String bomType,
                                      String verbalization,
                                      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,
                                           String name,
                                           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,
                                         String name,
                                         String returnType,
                                         String[] argNames,
                                         String[] argTypes,
                                         String body,
                                         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.

createActionRule

public static IlrActionRule createActionRule(IlrSession session,
                                             IlrRulePackage rulePackage,
                                             String name,
                                             String body)
                                      throws IlrApplicationException
Creates an action rule 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 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.
See Also:
createRule(IlrSession, org.eclipse.emf.ecore.EClass, ilog.rules.teamserver.brm.IlrRulePackage, String, String)

createVariableSet

public static IlrVariableSet createVariableSet(IlrSession session,
                                               IlrRulePackage rulePackage,
                                               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.

createTechnicalRule

public static IlrTechnicalRule createTechnicalRule(IlrSession session,
                                                   IlrRulePackage rulePackage,
                                                   String name,
                                                   String body)
                                            throws IlrApplicationException
Creates a technical rule 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 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.
See Also:
createRule(IlrSession, org.eclipse.emf.ecore.EClass, ilog.rules.teamserver.brm.IlrRulePackage, String, String)

createRule

public static IlrRule createRule(IlrSession session,
                                 org.eclipse.emf.ecore.EClass eclass,
                                 IlrRulePackage rulePackage,
                                 String name,
                                 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,
                                               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,
                                           String name,
                                           String bomType,
                                           int direction,
                                           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 String getDetailsURL(IlrSession session,
                                   String contextPath,
                                   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 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 String[] getPath(IlrElementHandle handle,
                               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 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.

checkElement

public static List<IlrElementError> checkElement(IlrSession session,
                                                 IlrBaseline baseline,
                                                 IlrElementHandle element)
                                          throws IlrApplicationException
Checks a given element for errors.

Throws:
IlrApplicationException
Parameters:
session - The session.
baseline - The baseline. If null, the method will use the working baseline.
element - The element to check.
Returns:
A list of errors or an empty list.

computeDependentBaselines

public static 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.

copyElementFromWorkingBaselineToBranch

public static IlrElementHandle copyElementFromWorkingBaselineToBranch(IlrSession session,
                                                                      IlrElementHandle element,
                                                                      IlrBaseline targetBranch)
                                                               throws IlrApplicationException
Throws:
IlrApplicationException

copyElementFromSourceBaselineToTargetBranch

public static IlrElementHandle copyElementFromSourceBaselineToTargetBranch(IlrSession session,
                                                                           IlrBaseline source,
                                                                           IlrElementHandle element,
                                                                           IlrBaseline targetBranch)
                                                                    throws IlrApplicationException
Throws:
IlrApplicationException

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 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,
                                                            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,
                                                            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,
                                                            String body,
                                                            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,
                                                            String body,
                                                            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,
                                                                    String body,
                                                                    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,
                                                                    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,
                                                                    String body,
                                                                    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 String publishProject(IlrSession session,
                                    File workspaceDir,
                                    boolean override,
                                    String projectName,
                                    String url,
                                    String userName,
                                    String password,
                                    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,
                                 File workspaceDir,
                                 boolean override,
                                 String url,
                                 String userName,
                                 String password,
                                 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

Decision Center API

© Copyright IBM Corp. 1987, 2013