public interface RuleEngine
Modifier and Type | Method and Description |
---|---|
RulesetContext |
createRulesetContext(String rulesetGUID)
Given a Ruleset GUID, this method will be used to create the
RulesetContext that can be used to
invoke a Ruleset. |
RulesetContext |
createRulesetContext(String projectName,
String rulesetName)
Given a Project name and the Ruleset name, this method can be used to
create the
RulesetContext that can be
used to invoke a Ruleset. |
AbstractProject |
getProject(String projectName)
This method returns the Project identified by the name in
projectName param. |
AbstractRuleset |
getRuleset(String projectName,
String rulesetName)
This method returns the Ruleset identified by the name in
rulesetName param from the Project identified by the name in
projectName param. |
RulesetContext |
invokeRuleEntity(RulesetContext rulesetContext)
Used to invoke rule entities such as a Decision Table directly.
|
RulesetContext |
invokeRuleset(RulesetContext rulesetContext)
This is one of the main methods to invoke the Rules in a Ruleset.
|
List |
invokeRuleset(String projectName,
String rulesetName,
List facts)
This is another method to invoke the Rules in a Ruleset.
|
RulesetContext createRulesetContext(String projectName, String rulesetName) throws NoSuchProjectException, NoSuchRuleException, RuleException, RemoteException
RulesetContext
that can be
used to invoke a Ruleset.projectName
- name of the ProjectrulesetName
- name of the RulesetNoSuchProjectException
NoSuchRuleException
RuleException
RemoteException
RulesetContext createRulesetContext(String rulesetGUID) throws NoSuchProjectException, NoSuchRuleException, RuleException, RemoteException
RulesetContext
that can be used to
invoke a Ruleset.rulesetGUID
- The GUID of the RulesetNoSuchProjectException
- if there is no Project for the Ruleset identified by the
rulesetGUIDNoSuchRuleException
- if there is no Ruleset by the given GUID in the repositoryRuleException
- if any error occurs while accessing the repositoryRemoteException
AbstractProject getProject(String projectName) throws NoSuchProjectException, RuleException, RemoteException
projectName
param.projectName
- name of the ProjectNoSuchProjectException
RuleException
RemoteException
AbstractRuleset getRuleset(String projectName, String rulesetName) throws NoSuchProjectException, NoSuchRuleException, RuleException, RemoteException
rulesetName
param from the Project identified by the name in
projectName
param.projectName
- name of the ProjectrulesetName
- name of the RulesetNoSuchProjectException
NoSuchRuleException
RuleException
RemoteException
RulesetContext invokeRuleset(RulesetContext rulesetContext) throws NoSuchProjectException, NoSuchRuleException, RuleException, RemoteException
invokeRuleset(String, String, List)
method, this
allows one a lot more flexibility in controlling the flow of data to/from
the Rule engine and also in obtaining more information pertaining to the
invocation. Please refer to the
RulesetContext
class
for more detailsrulesetContext
- The context of the Ruleset to invoke. The context contains all
details about the Ruleset and the facts to be used for
invocation.NoSuchRuleException
- thrown when there is no Ruleset found with the given nameRuleException
- thrown when there is an error with the Ruleset being
loaded and invoked. Typically it is an algorithm specific
exception or a I/O exception which is wrapped in the
generic RuleExceptionRemoteException
- thrown when the RuleEngine reference is a remote reference
and there is a network error or such errors associated
with distributed method invocationsNoSuchProjectException
List invokeRuleset(String projectName, String rulesetName, List facts) throws NoSuchProjectException, NoSuchRuleException, RuleException, RemoteException
projectName
- The name of the Project whose Ruleset should be invoked.rulesetName
- The name of the Ruleset to invokefacts
- A list of facts to assert for the invocationNoSuchProjectException
- - thrown when there is no Project found with the given
name.NoSuchRuleException
- - thrown when there is no Ruleset found with the given
name.RuleException
- - thrown when there is an error with the Ruleset being
loaded and invoked. Typically it is an algorithm specific
exception or a I/O exception which is wrapped in the
generic RuleException.RemoteException
- - thrown when the RuleEngine reference is a remote
reference and there is a network error or such errors
associated with distributed method invocations.RulesetContext invokeRuleEntity(RulesetContext rulesetContext) throws NoSuchProjectException, NoSuchRuleException, RuleException, RemoteException
RulesetContext
object can be used to exert greater control over
the information related to invocation flowing to/from the Rule Engine.
Sample code for invoking a Decision Table with the name myDecisionTable follows:
//This is how one gets an instance of the RulesetContext passing the Ruleset name RulesetContext ctxt = engine.createRulesetContext("myProject", "myRuleset"); ctxt.setEntity(EntityType.DECISION_TABLE, "myDecisionTable"); RulesetContext returnedContext = engine.invokeRuleEntity(ctxt);
Presently, this method supports invocation of only Decision Tables from a re-usable ruleset, apart from a ruleset or a flow ruleset.
The behaviour in case of other entities is not defined.
rulesetContext
- - the RulesetContext containing information related to
the invocation, specifically the facts to be used for
invocationNoSuchProjectException
- - thrown when no project is found with the name given in the RulesetContext
NoSuchRuleException
- - thrown when the rule entities e.g., the Ruleset or the
entity with the given names are not foundRuleException
- - thrown when an error is encountered while loading or
invoking the rule entities. Typically, the exception wraps an
underlying I/O exception, but any checked exception encountered during invocation
is bundled as a RuleExceptionRemoteException
- - thrown when the RuleEngine reference is a remote reference
and there is a network error or such errors associated with
distributed method invocations.RulesetContext
Access Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] BRMS-FACADE
|
[sap.com] tc/brms/facade
|
api
|
BC-BMT-BRM-ENG
|
Copyright 2018 SAP AG Complete Copyright Notice