OSID Logo
OSID Specifications
rules package
Version 3.0.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.Idthe Engine Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetEngine
Description

Gets the Engine associated with this session.

Returnosid.rules.Enginethe engine
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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.

Returnbooleanfalse if evaluation methods are not authorized, true otherwise
CompliancemandatoryThis 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.IdruleIdthe Id of a Rule
Returnosid.rules.Conditionthe returned Condition
ErrorsNOT_FOUNDno Rule found with the given Id
NULL_ARGUMENTruleId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodevaluateRuleOnCondition
Description

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

Parametersosid.id.IdruleIda rule Id
osid.rules.Conditionconditioninput condition
Returnbooleanresult of the evaluation
ErrorsNOT_FOUNDruleId is not found
NULL_ARGUMENTruleId or condition is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDcondition did not otiginate from getConditionForRule()
CompliancemandatoryThis method must be implemented.
MethodexecuteRuleOnCondition
Description

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

Parametersosid.id.IdruleIda rule Id
osid.rules.Conditionconditioninput conditions
Returnosid.rules.Resultresult of the execution
ErrorsNOT_FOUNDan Id was not found
NULL_ARGUMENTruleId or condition is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDcondition did not otiginate from getConditionForRule()
CompliancemandatoryThis method must be implemented.