In the README.md, there is an example of one creating a worklow and sending it to the rules engine. This MUST be an array (not a single workflow) and the current documentation if one was following along would not compile. I updated the sample code to have a new var List<Workflow> workflows which is passed to the rules engine. The sample 'Example Workflow' is the only workflow in this list of workflows. (#334)

Co-authored-by: Charlie King <charlie.king@dimensional.com>
pull/342/head v3.5.0
Charlie King 2022-03-18 04:19:09 -05:00 committed by GitHub
parent 4a2b345fe9
commit 99bad9ffff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -84,12 +84,15 @@ rule.Expression = "count < 3";
rule.RuleExpressionType = RuleExpressionType.LambdaExpression;
rules.Add(rule);
Workflow workflow = new Workflow();
workflow.WorkflowName = "Example Workflow";
workflow.Rules = rules;
workflow.Add(workflowRule);
var workflows = new List<Workflow>();
var bre = new RulesEngine.RulesEngine(workflow.ToArray(), null);
Workflow exampleWorkflow = new Workflow();
exampleWorkflow.WorkflowName = "Example Workflow";
exampleWorkflow.Rules = rules;
workflows.Add(exampleWorkflow);
var bre = new RulesEngine.RulesEngine(workflows.ToArray(), null);
```
### Entity Framework