|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.teamserver.model.IlrSessionHelper
public class IlrSessionHelper
IlrSessionHelper
contains a set of helper methods that you use
to manipulate Decision Center services and data.
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 |
---|
public IlrSessionHelper()
Method Detail |
---|
public static void setDefinition(IlrSession session, IlrElementHandle ruleArtifact, String body) throws IlrApplicationException
IlrApplicationException
- If something wrong happens during the operation.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).public static List getProjects(IlrSession session)
session
- The session to use to perform the search.
ilog.rules.teamserver.brm.IlrRuleProject
objects.public static IlrRuleProject getProjectNamed(IlrSession session, String name) throws IlrObjectNotFoundException
IlrObjectNotFoundException
session
- The session to use to perform the search.name
- The name of the searched project.
null
if the project cannot be found.public static IlrElementHandle createProject(IlrSession session, String name) throws IlrApplicationException
createRuleProject()
instead.
By default a project is set up to contain:
brm.BRLRule
IlrApplicationException
- If an error happens when creating the project.session
- The session to use to perform the operation.name
- Name of the project to create.
public static IlrRuleProject createRuleProject(IlrSession session, String name) throws IlrApplicationException
By default a project is set up to contain:
brm.BRLRule
IlrApplicationException
- If an error happens when creating the project.session
- The session to use to perform the operation.name
- The name of the project to create.
public static IlrRuleProject createEventProject(IlrSession session, String name) throws IlrApplicationException
By default a project is set up to contain the following smart views:
IlrApplicationException
- If an error happens when creating the project.session
- The session to use to perform the operation.name
- The name of the event project to create.
public static IlrRuleProject createRuleProject(IlrSession session, String name, String platform) throws IlrApplicationException
createRuleProject(IlrSession, String)
and createEventProject(IlrSession, String)
By default a project is set up to contain the following smart views:
brm.BRLRule
IlrApplicationException
- If an error happens when creating the project.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).
public static List getElementsFromPath(IlrSession session, String path) throws IlrObjectNotFoundException
This method works for elements stored in rule packages (that is, their package kind is IlrPackageKind.RULE_LITERAL
).
IlrObjectNotFoundException
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.
IlrElementDetails
objects.
public static List getElementsFromPath(IlrSession session, String path, IlrPackageKind packageKind) throws IlrObjectNotFoundException
IlrObjectNotFoundException
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.
IlrElementDetails
objects.IlrPackageKind
public static IlrElementDetails getElementFromPath(IlrSession session, String path) throws IlrObjectNotFoundException
This method works for elements stored in rule packages (that is, their package kind is IlrPackageKind.RULE_LITERAL
).
IlrObjectNotFoundException
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.
IlrElementDetails
objects. If several objects matching the path are found, the first one is returned.
public static IlrElementDetails getElementFromPath(IlrSession session, String path, IlrPackageKind packageKind) throws IlrObjectNotFoundException
IlrObjectNotFoundException
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.
IlrElementDetails
objects. If several objects matching the path are found, the first one is returned.IlrPackageKind
public static IlrBaseline getRecyclebinBaseline(IlrSession session, IlrElementHandle project) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- If the project cannot be found.session
- The session to use to perform the operation.project
- Handle on the project.
public static IlrBaseline getRecyclebinBaseline(IlrSession session) throws IlrObjectNotFoundException
IlrObjectNotFoundException
public static IlrBaseline getRecyclebinBaseline(IlrSession session, IlrProjectElement projectElement) throws IlrFolderLockedException, IlrInvalidElementException, IlrKnownUUIDException, IlrObjectLockedException, IlrObjectNotFoundException, IlrPermissionException
IlrFolderLockedException
IlrInvalidElementException
IlrKnownUUIDException
IlrObjectLockedException
IlrObjectNotFoundException
IlrPermissionException
public static IlrBranch getCurrentBaseline(IlrSession session, IlrElementHandle project) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- If the project cannot be found.session
- The session to use to perform the operation.project
- Handle on the project.
public static IlrBaseline getBaselineNamed(IlrSession session, IlrElementHandle project, String name) throws IlrObjectNotFoundException
IlrObjectNotFoundException
session
- The session to use to perform the operation.project
- Handle on the project.name
- The requested name.
null
if the baseline cannot be found.public static IlrBaseline getBaselineNamed(IlrSession session, IlrBaseline parentBaseline, String name) throws IlrObjectNotFoundException
IlrObjectNotFoundException
public static IlrBaseline getDeploymentBaselineNamed(IlrSession session, IlrBaseline parentBranch, String name, IlrRuleset ruleset) throws IlrObjectNotFoundException
IlrObjectNotFoundException
public static List<IlrBaseline> getDeployedBaselines(IlrSession session, IlrElementHandle ruleAppHandle)
session
- The session to use to perform the operation.ruleAppHandle
- Handle on the RuleApp.
public static List<String> getDeployedBaselinesNames(IlrSession session, IlrElementHandle ruleAppHandle)
session
- The session to use to perform the operation.ruleAppHandle
- Handle on the RuleApp.
public static IlrBOM createBOM(IlrSession session, String name, String body) throws IlrApplicationException
Note that no BOM entry is created.
IlrApplicationException
- If something wrong happens during the operation.session
- The session to use to perform the operation.name
- The requested name.body
- The requested body.
createBOM(IlrSession, String, String, boolean)
public static IlrBOM createBOM(IlrSession session, String name, String body, boolean createBOMEntry) throws IlrApplicationException
IlrApplicationException
- If something wrong happens during the operation.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.
public static IlrBOM2XOMMapping createBOM2XOMMapping(IlrSession session, String name, String body) throws IlrApplicationException
IlrApplicationException
- If something wrong happens during the operation.session
- The session to use to perform the operation.name
- The requested name.body
- The requested body.
public static IlrVocabulary createVocabulary(IlrSession session, String name, String body, Locale locale) throws IlrApplicationException
IlrApplicationException
- If something wrong happens during the operation.session
- The session to use to perform the operation.name
- The requested name.body
- The requested body.locale
- The locale of the vocabulary.
public static void createDependency(IlrSession session, IlrRuleProject src, IlrRuleProject dest, boolean createProjectBOMEntry) throws IlrApplicationException
IlrApplicationException
- If an error occurs while creating the new dependency.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.public static List<IlrBaseline> getBaselines(IlrSession session, IlrRuleProject project) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- If the project cannot be found in the database.session
- The session to use to perform the operation.project
- The requested name.
IlrBaseline
objects.public static IlrCommitableObject createFromTemplate(IlrSession session, IlrTemplate template) throws IlrObjectNotFoundException
Note: This does not commit anything.
IlrObjectNotFoundException
- If the template cannot be found in the database.session
- The session to use to perform the operation.template
- The template to use to instantiate the rule.
public static IlrSearchCriteria makeBuildCriteria(IlrSession session, IlrExtractor extractor) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- If the extractor cannot be found in the database.session
- The session.extractor
- The extractor to use.
public static IlrSearchCriteria makeBuildCriteria(IlrSession session, IlrQuery query)
session
- The session.query
- The query to use.
public static void setBOMPath(IlrSession session, IlrBaseline baseline, List bomPathEntries) throws IlrApplicationException
This methods first clears the old BOM path, if any, and inserts the new one, in the order specified by the list.
IlrApplicationException
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.public static ilog.rules.brl.brldf.IlrBRLVariableProvider makeVariableProvider(IlrSession session) throws IlrApplicationException
IlrApplicationException
- If something wrong happens.session
- The session.
public static IlrActionRule createActionRule(IlrSession session)
newActionRule(IlrSession)
instead.
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrActionRule newActionRule(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrRulePackage createRulePackage(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrRulePackage newRulePackage(IlrSession session)
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).
session
- The session.
newRulePackage(IlrSession, IlrPackageKind)
public static IlrRulePackage newRulePackage(IlrSession session, IlrPackageKind packageKind)
This simply creates a new object, but does not commit it in the database.
session
- The session.packageKind
- Can be IlrPackageKind.RULE_LITERAL, IlrPackageKind.TEMPLATE_LITERAL, IlrPackageKind.TESTING_LITERAL etc.
IlrPackageKind
public static IlrQuery createQuery(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrQuery newQuery(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrBOM createBOM(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrBOM newBOM(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrVocabulary createVocabulary(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrVocabulary newVocabulary(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrExtractor createExtractor(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrExtractor newExtractor(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrTag createTag(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrTag newTag(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrTemplate createTemplate(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrTemplate newTemplate(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrRuleflow createRuleflow(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrRuleflow newRuleflow(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrParameter createParameter(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrParameter newParameter(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrBOM2XOMMapping createBOM2XOMMapping(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrBOM2XOMMapping newBOM2XOMMapping(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrTechnicalRule createTechnicalrule(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrTechnicalRule newTechnicalrule(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrVariable createVariable(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrVariable newVariable(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrVariable newVariable(IlrSession session, String name, String bomType, String verbalization, String initialValue)
This simply creates a new object, but does not commit it in the database.
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.
public static IlrVariableSet createVariableSet(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrVariableSet newVariableSet(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrSmartView createView(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrSmartView newSmartView(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrSmartView createSmartView(IlrSession session, String name, String query, org.eclipse.emf.ecore.EStructuralFeature[] propertyPath) throws IlrApplicationException
IlrApplicationException
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.
public static IlrFunction createFunction(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrFunction newFunction(IlrSession session)
This simply creates a new object, but does not commit it in the database.
session
- The session.
public static IlrFunction createFunction(IlrSession session, IlrRulePackage rulePackage, String name, String returnType, String[] argNames, String[] argTypes, String body, String[] imports) throws IlrApplicationException
IlrApplicationException
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.*;".
public static IlrActionRule createActionRule(IlrSession session, IlrRulePackage rulePackage, String name, String body) throws IlrApplicationException
IlrApplicationException
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.
createRule(IlrSession, org.eclipse.emf.ecore.EClass, ilog.rules.teamserver.brm.IlrRulePackage, String, String)
public static IlrVariableSet createVariableSet(IlrSession session, IlrRulePackage rulePackage, String name, IlrVariable[] variables) throws IlrApplicationException
IlrApplicationException
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.
public static IlrTechnicalRule createTechnicalRule(IlrSession session, IlrRulePackage rulePackage, String name, String body) throws IlrApplicationException
IlrApplicationException
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.
createRule(IlrSession, org.eclipse.emf.ecore.EClass, ilog.rules.teamserver.brm.IlrRulePackage, String, String)
public static IlrRule createRule(IlrSession session, org.eclipse.emf.ecore.EClass eclass, IlrRulePackage rulePackage, String name, String body) throws IlrApplicationException
IlrApplicationException
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.
public static IlrRulePackage createRulePackage(IlrSession session, IlrRulePackage parent, String name) throws IlrApplicationException
IlrApplicationException
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.
public static IlrParameter createParameter(IlrSession session, String name, String bomType, int direction, String initialValue) throws IlrApplicationException
IlrApplicationException
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:
initialValue
- An IRL expression defining an initial value for this parameter.
public static String getDetailsURL(IlrSession session, String contextPath, String datasource, IlrElementHandle handle)
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.
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.
public static String getDetailsURL(IlrSession session, IlrElementHandle handle)
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.
session
- The current session.handle
- Handle on the element from which you want to display the details.
public static String[] getPath(IlrElementHandle handle, String projectName)
handle
- The element handle.projectName
- The project name.
public static String[] getPath(IlrSession session, IlrElementHandle handle, IlrBaseline baseline) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- if an object is not found while comnputing the path.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.
public static List<IlrElementError> checkElement(IlrSession session, IlrBaseline baseline, IlrElementHandle element) throws IlrApplicationException
IlrApplicationException
session
- The session.baseline
- The baseline. If null
, the method will use the working baseline.element
- The element to check.
public static List<IlrBaseline> computeDependentBaselines(IlrSession session, IlrBaseline baseline) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- If the source baseline cannot be found.session
- The session to use to make the computation.baseline
- The baseline for which you want to compute the dependencies.
IlrBaseline
objects.public static IlrElementHandle copyElementFromWorkingBaselineToBranch(IlrSession session, IlrElementHandle element, IlrBaseline targetBranch) throws IlrApplicationException
IlrApplicationException
public static IlrElementHandle copyElementFromSourceBaselineToTargetBranch(IlrSession session, IlrBaseline source, IlrElementHandle element, IlrBaseline targetBranch) throws IlrApplicationException
IlrApplicationException
public static IlrPackageElement copyTo(IlrSession session, IlrPackageElement packageElement, IlrRulePackage rulePackage) throws IlrApplicationException
IlrSession.copyTo
instead
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.
IlrApplicationException
- If an error occurs, in which case the whole operation is cancelled.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.
public static String dtControllerToStorableString(IlrSession session, ilog.rules.dt.IlrDTController controller)
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.
session
- The session to use in order to perform the operation.controller
- The DT controller.
public static ilog.rules.dt.IlrDTController getDTController(IlrSession session, IlrDecisionTree dtree, Locale locale) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- If the given handle references an element that cannot be found in the repository.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.
public static ilog.rules.dt.IlrDTController getDTController(IlrSession session, IlrDecisionTable dtable, Locale locale) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- If the given handle references an element that cannot be found in the repository.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.
public static ilog.rules.dt.IlrDTController getDTController(IlrSession session, IlrElementHandle handle, String body, Locale locale) throws IlrObjectNotFoundException
This string typically comes from the body property of a decision table or decision tree object.
IlrObjectNotFoundException
- If the given handle references an element that cannot be found in the repository.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.
public static ilog.rules.dt.IlrDTController getDTController(IlrSession session, IlrElementHandle handle, IlrElementVersion elementVersion, String body, Locale locale) throws IlrObjectNotFoundException
This string typically comes from the body property of a decision table or decision tree object.
IlrObjectNotFoundException
- If the given handle references an element that cannot be found in the repository.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.
public static ilog.rules.brl.syntaxtree.IlrSyntaxTree getSyntaxTree(IlrSession session, IlrElementHandle handle, IlrElementVersion elementVersion, String body, Locale locale) throws IlrObjectNotFoundException
This string typically comes from the body property of BRL rule object.
IlrObjectNotFoundException
- If the given handle references an element that cannot be found in the repository.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.
public static ilog.rules.brl.syntaxtree.IlrSyntaxTree getSyntaxTree(IlrSession session, IlrBRLRule rule, Locale locale) throws IlrObjectNotFoundException
IlrObjectNotFoundException
- If the given handle references an element that cannot be found in the repository.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.
public static ilog.rules.brl.syntaxtree.IlrSyntaxTree getSyntaxTree(IlrSession session, IlrElementHandle handle, String body, Locale locale) throws IlrObjectNotFoundException
This string typically comes from the body property of a BRL Rule object.
IlrObjectNotFoundException
- If the given handle references an element that cannot be found in the repository.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.
public static byte[] getRuleflowImage(IlrRuleflow ruleflow)
ruleflow
- The ruleflow to generate the image from.
public static byte[] getDecisionTreeImage(IlrDecisionTree decisionTree)
decisionTree
- The decision tree to generate the image from.
public static String publishProject(IlrSession session, File workspaceDir, boolean override, String projectName, String url, String userName, String password, String datasource)
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 synchronizationuserName
- The username used by synchronizationpassword
- The password for the username provideddatasource
- The datasource to use. Can be null if this is the default datasource
public static void importProject(IlrSession session, File workspaceDir, boolean override, String url, String userName, String password, String datasource)
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 synchronizationuserName
- The username used by synchronizationpassword
- The password for the username provideddatasource
- The datasource to use. Can be null if this is the default datasource
|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |