OSID Logo
OSID Specifications
rules package
Version 3.1.0
Interfaceosid.rules.RuleEvaluationSession
Implementsosid.OsidSession
Used Byosid.rules.RulesManager
osid.rules.RulesProxyManager
Description

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.

MethodgetEngineId
Description

Gets the Engine Id associated with this session.

Returnosid.id.Id the Engine Id associated with this session
Compliancemandatory This method must be implemented.
MethodgetEngine
Description

Gets the Engine associated with this session.

Returnosid.rules.Engine the engine
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanEvaluateRules
Description

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 a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer these operations.

Returnboolean false if evaluation methods are not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodgetCondition
Description

Gets a condition for the given rule. The record Types in the Condition are required for a successful evaluation.

Parametersosid.id.IdruleId the Id of a Rule
Returnosid.rules.Condition the returned Condition
ErrorsNOT_FOUND no Rule found with the given Id
NULL_ARGUMENT ruleId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodevaluateRuleOnCondition
Description

Evaluates a rule based on an input condition abd returns a boolean result.

Parametersosid.id.IdruleId a rule Id
osid.rules.Conditioncondition input condition
Returnboolean result of the evaluation
ErrorsNOT_FOUND ruleId is not found
NULL_ARGUMENT ruleId or condition is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED condition did not otiginate from getConditionForRule()
Compliancemandatory This method must be implemented.
MethodexecuteRuleOnCondition
Description

Executes a rule based on an input condition and returns a result.

Parametersosid.id.IdruleId a rule Id
osid.rules.Conditioncondition input conditions
Returnosid.rules.Result result of the execution
ErrorsNOT_FOUND an Id was not found
NULL_ARGUMENT ruleId or condition is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED condition did not otiginate from getConditionForRule()
Compliancemandatory This method must be implemented.