| Package | osid.rules |
|---|---|
| Title | Rules Open Service Interface Definitions |
| Version | 3.0.0 |
| Description |
The Rules OSID provides a means to evaluate rules and
retrieve results. A The Rules OSID does not define a means for authoring
rules. Definitions exist for evaluating, examining and
organizing rules. A Engines can be organized into hierarchies for federation. An engine that is a parent of another engine makes visible the rules of its children. Example where the consumer executes a rule with
knowledge of the
RulesSession session = manager.getRulesSession();
Condition condition = session.getConditionForRule(shouldIWearACoatRuleId);
if (!condition.hasRecordType(temperatureConditionRecordType) {
error ("temperature condition record not supported");
}
TemperatureCondition temp = condition.getConditionRecord(temperatureConditionRecordType);
temp.setTemperature(28);
if (session.evaluateRule(shouldIWearACoatRuleId, condition) {
putOnACoat();
}
|