public interface ITBRuleService
The service provides API to: - create/fetch/update/delete rule definitions - start a rule on a resource - rule the rule
Modifier and Type | Method and Description |
---|---|
ITBRuleDefinition |
createRuleDefinition(ITBRuleDefinition ruleDefinition)
Creates a rule definition
|
void |
deleteRuleDefinitions(java.util.Set<Id> ruleDefinitionIds)
Deletes rule definitions by IDs
|
ITBRuleDefinition |
discardDraftRuleDefinition(Id ruleDefinitionId)
Discard the draft content of the rule definition.
|
void |
enableAsyncCalculations(boolean enabled)
Enables or disables asynchronous calculations.
|
void |
enableRuleDefinitions(java.util.Set<Id> ruleDefinitionIds,
boolean enabled)
enable or disable rule definitions by IDs
|
int |
estimateStartingCalculationsInBulk(Id ruleDefinitionId)
Returns estimated count that would meet the criteria to run the calculation in bulk
|
java.util.List<ITBRuleDefinition> |
evaluateRules(java.util.List<ITBRuleDefinition> rules,
Id resourceId)
Evaluates a list of rules against a resource and returns the valid rules.
|
void |
executeRules(java.util.List<ITBRuleDefinition> rules,
Id resourceId)
Evaluates and executes a list of rules on a resource.
|
java.util.Map<Id,java.util.Set<Id>> |
getAsyncCalculationRequests(java.util.Set<Id> resourceIds)
Returns the resources in the asynchronous calculation queue.
|
java.util.Map<Id,TBCalcCounts> |
getCalcStats(java.util.Set<Id> calcDefIds)
Returns the statistics of the calculations such as how many resources are in the queue for asynchronous calculation,
or how many resources have calculation errors for a given calculation definition.
|
ITBRuleDefinition |
getRuleDefinition(Id ruleDefinitionId,
boolean draft)
Returns a rule definition by ID
|
ITBRuleDefinition |
getRuleDefinition(java.lang.String name,
Id typeDefinitionId,
boolean draft)
Returns a rule definition by name, type definition ID
|
ITBRuleDefinition |
getRuleDefinitionByVersionId(Id versionId)
Returns the rule definition by the version ID
|
java.util.List<ITBRuleDefinition> |
getRuleDefinitions()
Deprecated.
|
java.util.List<ITBRuleDefinition> |
getRuleDefinitions(Id ruleDefinitionId)
Returns the published and draft versions of the rule definition if they exist.
|
TBRuleDefinitionList |
getRuleDefinitions(ITBRuleDefinitionFindOptions ruleDefinitionFindOptions)
Returns list of rule definitions based on the criteria defined by the
ITBRuleDefinitionFindOptions |
java.util.List<ITBRuleDefinition> |
getRuleDefinitionsByRuleType(TBRuleDefinitionType type)
Returns the latest published version of all
ITBRuleDefinitions s by TBRuleDefinitionType
that are currently enabled. |
java.util.List<ITBRuleDefinition> |
getRuleDefinitionsByType(Id objectType)
Returns the latest version of all
ITBRuleDefinition s by object type |
ITBRuleFactory |
getRuleFactory()
Returns a new rule factory object.
|
java.util.List<ITBRuleDefinition> |
getRunnableRules(Id objectType,
TBRuleDefinitionType ruleType)
Get all runnable rules for an object type
|
void |
hardDeleteRuleDefinitions(java.util.Set<Id> ruleDefinitionIds)
Hard-deletes rule definitions by IDs.
|
void |
processAsyncCalculations(java.util.Set<Id> resourceIds,
boolean synchronous)
Requests asynchronous calculations of the given resources to handle earlier than others by increasing the priority.
|
IGRCObject |
processCalculationsOnDemand(IGRCObject object)
Evaluates applicable rules for a resource's fields and returns the object with
calculated values set, but does not persist the calculated values.
|
ITBRuleDefinition |
publishRuleDefinition(Id ruleDefinitionId)
Publish the draft content of the rule definition, so it can be used
during the resource creation or the user's submission.
|
Id |
startCalculationsInBulk(BulkRunCalculationsOptions options)
Starts calculations on any objects that meet the following criteria, through a long running process
- on the object type of the calculation
- object is unlocked
- the object meets the applicability criteria of the calculation definition
|
ITBRuleDefinition |
updateRuleDefinition(ITBRuleDefinition ruleDefinition)
Updates a rule definition.
|
void |
validateRuleDefinition(ITBRuleDefinition ruleDefinition)
Validates the given rule definition and throws an
TBRuleException when there is an issue. |
java.util.List<ITBRuleDefinition> getRuleDefinitions(Id ruleDefinitionId)
ruleDefinitionId
- java.util.List<ITBRuleDefinition> getRuleDefinitions()
ITBRuleDefinition
s. Used by object manager.
Probably a temporary method until getRuleDefinitions(IRuleDefinitionFindOptions ruleOptions)
is implemented.java.util.List<ITBRuleDefinition> getRuleDefinitionsByType(Id objectType)
ITBRuleDefinition
s by object typeobjectType
- the rule definitions applicable to a specific typejava.util.List<ITBRuleDefinition> getRuleDefinitionsByRuleType(TBRuleDefinitionType type)
ITBRuleDefinitions
s by TBRuleDefinitionType
that are currently enabled.
Rule Definition types are: create, standard, calculationtype
- TBRuleDefinitionList getRuleDefinitions(ITBRuleDefinitionFindOptions ruleDefinitionFindOptions)
ITBRuleDefinitionFindOptions
ITBRuleDefinition getRuleDefinitionByVersionId(Id versionId)
versionId
- ITBRuleDefinition getRuleDefinition(java.lang.String name, Id typeDefinitionId, boolean draft)
name
- typeDefinitionId
- draft
- ITBRuleDefinition getRuleDefinition(Id ruleDefinitionId, boolean draft)
ruleDefinitionId
- draft
- java.util.List<ITBRuleDefinition> getRunnableRules(Id objectType, TBRuleDefinitionType ruleType)
objectType
- ruleType
- ITBRuleDefinition createRuleDefinition(ITBRuleDefinition ruleDefinition)
ruleDefinition
- ITBRuleDefinition updateRuleDefinition(ITBRuleDefinition ruleDefinition)
ruleDefinition
- void deleteRuleDefinitions(java.util.Set<Id> ruleDefinitionIds)
ruleDefinitionIds
- void hardDeleteRuleDefinitions(java.util.Set<Id> ruleDefinitionIds)
deleteRuleDefinitions(Set)
, this API will completely
remove the rule definition and its associated rule/activity instances from the database, so there is not way to recover it.ruleDefinitionIds
- ITBRuleDefinition publishRuleDefinition(Id ruleDefinitionId)
ruleDefinitionId
- ITBRuleDefinition discardDraftRuleDefinition(Id ruleDefinitionId)
ruleDefinitionId
- void enableRuleDefinitions(java.util.Set<Id> ruleDefinitionIds, boolean enabled)
ruleDefinitionIds
- enabled
- void executeRules(java.util.List<ITBRuleDefinition> rules, Id resourceId)
rules
- resourceId
- java.util.List<ITBRuleDefinition> evaluateRules(java.util.List<ITBRuleDefinition> rules, Id resourceId)
rules
- resourceId
- IGRCObject processCalculationsOnDemand(IGRCObject object)
object
- ITBRuleFactory getRuleFactory()
java.util.Map<Id,java.util.Set<Id>> getAsyncCalculationRequests(java.util.Set<Id> resourceIds)
resourceIds
- - set of resources to test if they have asynchronous calculation requests.void enableAsyncCalculations(boolean enabled)
enabled
- void processAsyncCalculations(java.util.Set<Id> resourceIds, boolean synchronous)
resourceId
- java.util.Map<Id,TBCalcCounts> getCalcStats(java.util.Set<Id> calcDefIds)
calcDefIds
- : a set of calculation definition IDs to get the statistics. If the parameter is null or empty, it returns statistics for all the calculation definitions.void validateRuleDefinition(ITBRuleDefinition ruleDefinition)
TBRuleException
when there is an issue.ruleDefinition
- Id startCalculationsInBulk(BulkRunCalculationsOptions options)
options
- int estimateStartingCalculationsInBulk(Id ruleDefinitionId)
ruleDefinitionId
-
Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights -
Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.