Interface RuleEvaluationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to evaluate and execute rules. An
Condition is acquired for input into a Rule . The
ConditionRecords in the Condition must be supplied to a specific
Rule for its evaluation to be successful. Knowledge of a specific
rule Id is also an agreement to the understanding of the required
ConditionRecords as well as what is expected as a result. These
record types may be inspected in the ConditionRecord and
ResultRecord respectively.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can evaluate rules.booleanevaluateRuleOnCondition(Id ruleId, Condition condition) Evaluates a rule based on an input condition abd returns a boolean result.executeRuleOnCondition(Id ruleId, Condition condition) Executes a rule based on an input condition and returns a result.getCondition(Id ruleId) Gets a condition for the given rule.Gets theEngineassociated with this session.Gets theEngineIdassociated with this session.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getEngineId
Id getEngineId()Gets theEngineIdassociated with this session.- Returns:
- the
Engine Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getEngine
Gets theEngineassociated with this session.- Returns:
- the engine
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canEvaluateRules
boolean canEvaluateRules()Tests if this user can evaluate rules. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer these operations.- Returns:
falseif evaluation methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getCondition
Condition getCondition(Id ruleId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a condition for the given rule. The recordTypesin theConditionare required for a successful evaluation.- Parameters:
ruleId- theIdof aRule- Returns:
- the returned
Condition - Throws:
NotFoundException- noRulefound with the givenIdNullArgumentException-ruleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
evaluateRuleOnCondition
boolean evaluateRuleOnCondition(Id ruleId, Condition condition) throws NotFoundException, OperationFailedException, PermissionDeniedException Evaluates a rule based on an input condition abd returns a boolean result.- Parameters:
ruleId- a ruleIdcondition- input condition- Returns:
- result of the evaluation
- Throws:
NotFoundException-ruleIdis not foundNullArgumentException-ruleIdorconditionisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-conditiondid not otiginate fromgetConditionForRule()- Compliance:
mandatory- This method must be implemented.
-
executeRuleOnCondition
Result executeRuleOnCondition(Id ruleId, Condition condition) throws NotFoundException, OperationFailedException, PermissionDeniedException Executes a rule based on an input condition and returns a result.- Parameters:
ruleId- a ruleIdcondition- input conditions- Returns:
- result of the execution
- Throws:
NotFoundException- anIdwas not foundNullArgumentException-ruleIdorconditionisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-conditiondid not otiginate fromgetConditionForRule()- Compliance:
mandatory- This method must be implemented.
-