|
|
|
Evaluator class
Namespace: CodeEffects.Rule.Core
Assembly: CodeEffects.Rule.dll
Provides core functionality for the evaluation of business rules when the exact type of the source object varies between evaluations of the same rule. Read the rule evaluation topic for details.
Syntax
public class Evaluator :
CodeEffects.Rule.Core.EvaluatorBase
Constructors
-
Parameters:
- sourceType, System.Type - Type of the source object.
- rulesetXml, System.String - This string can contain either an outer XML of a single Rule XML document, or an outer XML of a single <rule> node that contains a business rule, or a collection of rules called the ruleset.
- getRule, CodeEffects.Rule.Core.GetRuleDelegate - This nullable parameter takes a reference to a method that returns string Rule XML by rule ID. Pass this delegate if your rule(s) may potentially reference reusable rules while the first parameter is not a ruleset or it does not contain the referenced reusable rules.
Methods
-
Evaluate(System.Object, System.String = null) Returns: System.Boolean
Parameters:
- source, System.Object - Instance of the source object.
- ruleId, System.String - If the Rule XML passed to the constructor of this class is a ruleset then this nullable parameter contains the ID of the particular rule located inside of that ruleset. The DynamicEvaluator uses this ID to retrieve the rule from the ruleset and evaluate the source against it.
For evaluation type rules, returns the result of the evaluation. For execution type rules, returns True if any rule action was invoked during the evaluation. Otherwise, returns False.
|