Updates System.Workflow.Activities.Rules to bring the RuleEngine functionality to .NetStandard.
$ dotnet add package LogicBuilder.Workflow.Activities.RulesA powerful, forward-chaining rules engine for .NET that enables dynamic business rule evaluation and execution without recompilation. This library provides a flexible framework for defining, validating, and executing business rules using CodeDOM expressions.
LogicBuilder.Workflow.Activities.Rules is a .NET rules engine that allows you to:
The RuleEngine class is the execution engine that processes validated rule sets against target objects. It handles:
The RuleSet class represents a collection of rules that can be executed together. Features include:
Properties:
Name - Unique identifier for the rule setDescription - Optional documentationRules - Collection of Rule objectsChainingBehavior - Controls how rules trigger re-evaluationChaining Behaviors:
Full - Rules can trigger re-evaluation of all other rulesSequential - Rules execute in priority order without re-evaluationNone - No forward chainingThe RuleValidation class validates rule expressions against target types and provides type resolution services. It:
Key Capabilities:
The library supports a rich set of CodeDOM expressions:
Rules can trigger re-evaluation of other rules when they modify object state, enabling complex rule dependencies and cascading logic.
Use RuleUpdateAction to explicitly mark properties as updated, forcing re-evaluation of dependent rules:
rule.ThenActions.Add(new RuleUpdateAction("this/PropertyName"));
This library is ideal for: