From 99bad9ffff7dabfa25328c0e0365bccfe2077d8e Mon Sep 17 00:00:00 2001 From: Charlie King Date: Fri, 18 Mar 2022 04:19:09 -0500 Subject: [PATCH] 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 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 --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fb965fc7..cc967e4b 100644 --- a/README.md +++ b/README.md @@ -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(); -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