diff --git a/README.md b/README.md index 113feee8..c4329868 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ To install this library, download the latest version of [NuGet Package](https:// There are several ways to populate workflows for the Rules Engine as listed below. -You need to store the rules based on the [schema definition](https://github.com/microsoft/RulesEngine/blob/main/schema/workflowRules-schema.json) given and they can be stored in any store as deemed appropriate like Azure Blob Storage, Cosmos DB, Azure App Configuration, [Entity Framework](https://github.com/microsoft/RulesEngine#entity-framework), SQL Servers, file systems etc. For RuleExpressionType `LamdaExpression`, the rule is written as a [lambda expressions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions). +You need to store the rules based on the [schema definition](https://github.com/microsoft/RulesEngine/blob/main/schema/workflow-schema.json) given and they can be stored in any store as deemed appropriate like Azure Blob Storage, Cosmos DB, Azure App Configuration, [Entity Framework](https://github.com/microsoft/RulesEngine#entity-framework), SQL Servers, file systems etc. For RuleExpressionType `LamdaExpression`, the rule is written as a [lambda expressions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions). An example rule: @@ -33,7 +33,7 @@ An example rule: "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.country == \"india\" AND input1.loyalityFactor <= 2 AND input1.totalPurchasesToDate >= 5000" + "Expression": "input1.country == \"india\" AND input1.loyaltyFactor <= 2 AND input1.totalPurchasesToDate >= 5000" }, { "RuleName": "GiveDiscount20", @@ -41,7 +41,7 @@ An example rule: "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.country == \"india\" AND input1.loyalityFactor >= 3 AND input1.totalPurchasesToDate >= 10000" + "Expression": "input1.country == \"india\" AND input1.loyaltyFactor >= 3 AND input1.totalPurchasesToDate >= 10000" } ] } @@ -106,7 +106,7 @@ var bre = new RulesEngine.RulesEngine(wfr, null); ![](https://github.com/microsoft/RulesEngine/blob/main/assets/BlockDiagram.png) -The rules can be stored in any store and be fed to the system in a structure which adheres to the [schema](https://github.com/microsoft/RulesEngine/blob/main/schema/workflowRules-schema.json) of WorkFlow model. +The rules can be stored in any store and be fed to the system in a structure which adheres to the [schema](https://github.com/microsoft/RulesEngine/blob/main/schema/workflow-schema.json) of WorkFlow model. A wrapper needs to be created over the Rules Engine package, which will get the rules and input message(s) from any store that your system dictates and put it into the Engine. The wrapper then handles the output using appropriate means. diff --git a/RulesEngine.sln b/RulesEngine.sln index 5311ba85..06370e32 100644 --- a/RulesEngine.sln +++ b/RulesEngine.sln @@ -18,7 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution CHANGELOG.md = CHANGELOG.md global.json = global.json README.md = README.md - schema\workflowRules-schema.json = schema\workflowRules-schema.json + schema\workflow-schema.json = schema\workflow-schema.json EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RulesEngineBenchmark", "benchmark\RulesEngineBenchmark\RulesEngineBenchmark.csproj", "{C058809F-C720-4EFC-925D-A486627B238B}" diff --git a/benchmark/RulesEngineBenchmark/Workflows/Discount.json b/benchmark/RulesEngineBenchmark/Workflows/Discount.json index 7bc678f5..ad556d90 100644 --- a/benchmark/RulesEngineBenchmark/Workflows/Discount.json +++ b/benchmark/RulesEngineBenchmark/Workflows/Discount.json @@ -8,7 +8,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.country == \"india\" AND input1.loyalityFactor <= 2 AND input1.totalPurchasesToDate >= 5000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 2" + "Expression": "input1.country == \"india\" AND input1.loyaltyFactor <= 2 AND input1.totalPurchasesToDate >= 5000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 2" }, { "RuleName": "GiveDiscount20", @@ -16,7 +16,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.country == \"india\" AND input1.loyalityFactor == 3 AND input1.totalPurchasesToDate >= 10000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 2" + "Expression": "input1.country == \"india\" AND input1.loyaltyFactor == 3 AND input1.totalPurchasesToDate >= 10000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 2" }, { "RuleName": "GiveDiscount25", @@ -24,7 +24,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.country != \"india\" AND input1.loyalityFactor >= 2 AND input1.totalPurchasesToDate >= 10000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 5" + "Expression": "input1.country != \"india\" AND input1.loyaltyFactor >= 2 AND input1.totalPurchasesToDate >= 10000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 5" }, { "RuleName": "GiveDiscount30", @@ -32,7 +32,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.loyalityFactor > 3 AND input1.totalPurchasesToDate >= 50000 AND input1.totalPurchasesToDate <= 100000 AND input2.totalOrders > 5 AND input3.noOfVisitsPerMonth > 15" + "Expression": "input1.loyaltyFactor > 3 AND input1.totalPurchasesToDate >= 50000 AND input1.totalPurchasesToDate <= 100000 AND input2.totalOrders > 5 AND input3.noOfVisitsPerMonth > 15" }, { "RuleName": "GiveDiscount30NestedOrExample", @@ -46,7 +46,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.loyalityFactor > 3 AND input1.totalPurchasesToDate >= 50000 AND input1.totalPurchasesToDate <= 100000" + "Expression": "input1.loyaltyFactor > 3 AND input1.totalPurchasesToDate >= 50000 AND input1.totalPurchasesToDate <= 100000" }, { "RuleName": "OrHasHighNumberOfTotalOrders", @@ -69,7 +69,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.loyalityFactor > 3" + "Expression": "input1.loyaltyFactor > 3" }, { "RuleName": "AndHasTotalPurchased100000", diff --git a/demo/DemoApp/EFDemo.cs b/demo/DemoApp/EFDemo.cs index 60c00ef5..a02f5a3f 100644 --- a/demo/DemoApp/EFDemo.cs +++ b/demo/DemoApp/EFDemo.cs @@ -20,7 +20,7 @@ public class EFDemo public void Run() { Console.WriteLine($"Running {nameof(EFDemo)}...."); - var basicInfo = "{\"name\": \"hello\",\"email\": \"abcy@xyz.com\",\"creditHistory\": \"good\",\"country\": \"canada\",\"loyalityFactor\": 3,\"totalPurchasesToDate\": 10000}"; + var basicInfo = "{\"name\": \"hello\",\"email\": \"abcy@xyz.com\",\"creditHistory\": \"good\",\"country\": \"canada\",\"loyaltyFactor\": 3,\"totalPurchasesToDate\": 10000}"; var orderInfo = "{\"totalOrders\": 5,\"recurringItems\": 2}"; var telemetryInfo = "{\"noOfVisitsPerMonth\": 10,\"percentageOfBuyingToVisit\": 15}"; diff --git a/demo/DemoApp/JSONDemo.cs b/demo/DemoApp/JSONDemo.cs index 042c37f5..88f9ad95 100644 --- a/demo/DemoApp/JSONDemo.cs +++ b/demo/DemoApp/JSONDemo.cs @@ -17,7 +17,7 @@ public class JSONDemo public void Run() { Console.WriteLine($"Running {nameof(JSONDemo)}...."); - var basicInfo = "{\"name\": \"hello\",\"email\": \"abcy@xyz.com\",\"creditHistory\": \"good\",\"country\": \"canada\",\"loyalityFactor\": 3,\"totalPurchasesToDate\": 10000}"; + var basicInfo = "{\"name\": \"hello\",\"email\": \"abcy@xyz.com\",\"creditHistory\": \"good\",\"country\": \"canada\",\"loyaltyFactor\": 3,\"totalPurchasesToDate\": 10000}"; var orderInfo = "{\"totalOrders\": 5,\"recurringItems\": 2}"; var telemetryInfo = "{\"noOfVisitsPerMonth\": 10,\"percentageOfBuyingToVisit\": 15}"; diff --git a/demo/DemoApp/Workflows/Discount.json b/demo/DemoApp/Workflows/Discount.json index 7bc678f5..ad556d90 100644 --- a/demo/DemoApp/Workflows/Discount.json +++ b/demo/DemoApp/Workflows/Discount.json @@ -8,7 +8,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.country == \"india\" AND input1.loyalityFactor <= 2 AND input1.totalPurchasesToDate >= 5000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 2" + "Expression": "input1.country == \"india\" AND input1.loyaltyFactor <= 2 AND input1.totalPurchasesToDate >= 5000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 2" }, { "RuleName": "GiveDiscount20", @@ -16,7 +16,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.country == \"india\" AND input1.loyalityFactor == 3 AND input1.totalPurchasesToDate >= 10000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 2" + "Expression": "input1.country == \"india\" AND input1.loyaltyFactor == 3 AND input1.totalPurchasesToDate >= 10000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 2" }, { "RuleName": "GiveDiscount25", @@ -24,7 +24,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.country != \"india\" AND input1.loyalityFactor >= 2 AND input1.totalPurchasesToDate >= 10000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 5" + "Expression": "input1.country != \"india\" AND input1.loyaltyFactor >= 2 AND input1.totalPurchasesToDate >= 10000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 5" }, { "RuleName": "GiveDiscount30", @@ -32,7 +32,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.loyalityFactor > 3 AND input1.totalPurchasesToDate >= 50000 AND input1.totalPurchasesToDate <= 100000 AND input2.totalOrders > 5 AND input3.noOfVisitsPerMonth > 15" + "Expression": "input1.loyaltyFactor > 3 AND input1.totalPurchasesToDate >= 50000 AND input1.totalPurchasesToDate <= 100000 AND input2.totalOrders > 5 AND input3.noOfVisitsPerMonth > 15" }, { "RuleName": "GiveDiscount30NestedOrExample", @@ -46,7 +46,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.loyalityFactor > 3 AND input1.totalPurchasesToDate >= 50000 AND input1.totalPurchasesToDate <= 100000" + "Expression": "input1.loyaltyFactor > 3 AND input1.totalPurchasesToDate >= 50000 AND input1.totalPurchasesToDate <= 100000" }, { "RuleName": "OrHasHighNumberOfTotalOrders", @@ -69,7 +69,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.loyalityFactor > 3" + "Expression": "input1.loyaltyFactor > 3" }, { "RuleName": "AndHasTotalPurchased100000", diff --git a/schema/workflowRules-schema.json b/schema/workflow-schema.json similarity index 100% rename from schema/workflowRules-schema.json rename to schema/workflow-schema.json diff --git a/src/RulesEngine/RulesEngine.csproj b/src/RulesEngine/RulesEngine.csproj index c21edd87..9ff39348 100644 --- a/src/RulesEngine/RulesEngine.csproj +++ b/src/RulesEngine/RulesEngine.csproj @@ -6,7 +6,7 @@ Copyright (c) Microsoft Corporation. LICENSE https://github.com/microsoft/RulesEngine - Abbas Cyclewala, Dishant Munjal, Yogesh Prajapati + Abbas Cyclewala, Dishant Munjal, Yogesh Prajapati, Alex Reich Rules Engine is a package for abstracting business logic/rules/policies out of the system. This works in a very simple way by giving you an ability to put your rules in a store outside the core logic of the system thus ensuring that any change in rules doesn't affect the core system. https://github.com/microsoft/RulesEngine/blob/main/CHANGELOG.md BRE, Rules Engine, Abstraction diff --git a/test/RulesEngine.UnitTest/BusinessRuleEngineTest.cs b/test/RulesEngine.UnitTest/BusinessRuleEngineTest.cs index 89043e90..8bef3bf0 100644 --- a/test/RulesEngine.UnitTest/BusinessRuleEngineTest.cs +++ b/test/RulesEngine.UnitTest/BusinessRuleEngineTest.cs @@ -775,7 +775,7 @@ private Workflow ParseAsWorkflow(string WorkflowsFileName) private dynamic GetInput1() { var converter = new ExpandoObjectConverter(); - var basicInfo = "{\"name\": \"Dishant\",\"email\": \"abc@xyz.com\",\"creditHistory\": \"good\",\"country\": \"canada\",\"loyalityFactor\": 3,\"totalPurchasesToDate\": 10000}"; + var basicInfo = "{\"name\": \"Dishant\",\"email\": \"abc@xyz.com\",\"creditHistory\": \"good\",\"country\": \"canada\",\"loyaltyFactor\": 3,\"totalPurchasesToDate\": 10000}"; return JsonConvert.DeserializeObject(basicInfo, converter); } @@ -801,10 +801,10 @@ private dynamic GetInput3() /// private static dynamic[] GetInputs4() { - var basicInfo = "{\"name\": \"Dishant\",\"email\": \"abc@xyz.com\",\"creditHistory\": \"good\",\"country\": \"canada\",\"loyalityFactor\": 3,\"totalPurchasesToDate\": 70000}"; + var basicInfo = "{\"name\": \"Dishant\",\"email\": \"abc@xyz.com\",\"creditHistory\": \"good\",\"country\": \"canada\",\"loyaltyFactor\": 3,\"totalPurchasesToDate\": 70000}"; var orderInfo = "{\"totalOrders\": 50,\"recurringItems\": 2}"; var telemetryInfo = "{\"noOfVisitsPerMonth\": 10,\"percentageOfBuyingToVisit\": 15}"; - var laborCategoriesInput = "[{\"country\": \"india\", \"loyalityFactor\": 2, \"totalPurchasesToDate\": 20000}]"; + var laborCategoriesInput = "[{\"country\": \"india\", \"loyaltyFactor\": 2, \"totalPurchasesToDate\": 20000}]"; var currentLaborCategoryInput = "{\"CurrentLaborCategoryProp\":\"TestVal2\"}"; dynamic input1 = JsonConvert.DeserializeObject>(laborCategoriesInput); diff --git a/test/RulesEngine.UnitTest/RuleTestClass.cs b/test/RulesEngine.UnitTest/RuleTestClass.cs index 0a028f07..37483804 100644 --- a/test/RulesEngine.UnitTest/RuleTestClass.cs +++ b/test/RulesEngine.UnitTest/RuleTestClass.cs @@ -12,8 +12,8 @@ public class RuleTestClass [JsonProperty("country")] public string Country { get; set; } - [JsonProperty("loyalityFactor")] - public int LoyalityFactor { get; set; } + [JsonProperty("loyaltyFactor")] + public int loyaltyFactor { get; set; } public int TotalPurchasesToDate { get; set; } } } diff --git a/test/RulesEngine.UnitTest/TestData/rules1.json b/test/RulesEngine.UnitTest/TestData/rules1.json index e0cc70e3..a3034fed 100644 --- a/test/RulesEngine.UnitTest/TestData/rules1.json +++ b/test/RulesEngine.UnitTest/TestData/rules1.json @@ -7,7 +7,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.country == \"canada\" AND input1.loyalityFactor <= 4" + "Expression": "input1.country == \"canada\" AND input1.loyaltyFactor <= 4" } ] } \ No newline at end of file diff --git a/test/RulesEngine.UnitTest/TestData/rules2.json b/test/RulesEngine.UnitTest/TestData/rules2.json index b94a55d1..01931c91 100644 --- a/test/RulesEngine.UnitTest/TestData/rules2.json +++ b/test/RulesEngine.UnitTest/TestData/rules2.json @@ -13,7 +13,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.country == \"india\" AND input1.loyalityFactor <= 2 AND input1.totalPurchasesToDate >= 5000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 2" + "Expression": "input1.country == \"india\" AND input1.loyaltyFactor <= 2 AND input1.totalPurchasesToDate >= 5000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 2" }, { "RuleName": "GiveDiscount20", @@ -21,7 +21,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.country == \"india\" AND input1.loyalityFactor == 3 AND input1.totalPurchasesToDate >= 10000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 2" + "Expression": "input1.country == \"india\" AND input1.loyaltyFactor == 3 AND input1.totalPurchasesToDate >= 10000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 2" }, { "RuleName": "GiveDiscount25", @@ -29,7 +29,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.country != \"india\" AND input1.loyalityFactor >= 2 AND input1.totalPurchasesToDate >= 10000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 5" + "Expression": "input1.country != \"india\" AND input1.loyaltyFactor >= 2 AND input1.totalPurchasesToDate >= 10000 AND input2.totalOrders > 2 AND input3.noOfVisitsPerMonth > 5" } ] } diff --git a/test/RulesEngine.UnitTest/TestData/rules3.json b/test/RulesEngine.UnitTest/TestData/rules3.json index e98d80c5..e81a3fa5 100644 --- a/test/RulesEngine.UnitTest/TestData/rules3.json +++ b/test/RulesEngine.UnitTest/TestData/rules3.json @@ -7,7 +7,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input1.couy == \"india\" AND input1.loyalityFactor <= 2 AND input1.totalPurchasesToDate >= 5000 AND input2.totalOrders > 2 AND input2.noOfVisitsPerMonth > 2" + "Expression": "input1.couy == \"india\" AND input1.loyaltyFactor <= 2 AND input1.totalPurchasesToDate >= 5000 AND input2.totalOrders > 2 AND input2.noOfVisitsPerMonth > 2" } ] } \ No newline at end of file diff --git a/test/RulesEngine.UnitTest/TestData/rules4.json b/test/RulesEngine.UnitTest/TestData/rules4.json index 097d6d45..4f11a8f8 100644 --- a/test/RulesEngine.UnitTest/TestData/rules4.json +++ b/test/RulesEngine.UnitTest/TestData/rules4.json @@ -5,7 +5,7 @@ { "RuleName": "GiveDiscount10", "SuccessEvent": "10", - "ErrorMessage": "One or more adjust rules failed, with loyalityFactor : $(model1.loyalityFactor), country : $(model1.country), totalPurchasesToDate : $(model1.totalPurchasesToDate), model2 : $(model2)", + "ErrorMessage": "One or more adjust rules failed, with loyaltyFactor : $(model1.loyaltyFactor), country : $(model1.country), totalPurchasesToDate : $(model1.totalPurchasesToDate), model2 : $(model2)", "ErrorType": "Error", "localParams": [ { @@ -18,7 +18,7 @@ } ], "RuleExpressionType": "LambdaExpression", - "Expression": "model1.country == \"india\" AND model1.loyalityFactor <= 2 AND model1.totalPurchasesToDate >= 5000 AND model2" + "Expression": "model1.country == \"india\" AND model1.loyaltyFactor <= 2 AND model1.totalPurchasesToDate >= 5000 AND model2" }, { "RuleName": "GiveDiscount100", @@ -35,12 +35,12 @@ } ], "RuleExpressionType": "LambdaExpression", - "Expression": "model1.country == \"india\" AND model1.loyalityFactor < 0 AND model1.totalPurchasesToDate >= 5000 AND model2" + "Expression": "model1.country == \"india\" AND model1.loyaltyFactor < 0 AND model1.totalPurchasesToDate >= 5000 AND model2" }, { "RuleName": "GiveDiscount25", "SuccessEvent": "25", - "ErrorMessage": "One or more adjust rules failed, country : $(input4.country), loyalityFactor : $(input4.loyalityFactor), totalPurchasesToDate : $(input4.totalPurchasesToDate), totalOrders : $(input5.totalOrders), noOfVisitsPerMonth : $(input30.noOfVisitsPerMonth)", + "ErrorMessage": "One or more adjust rules failed, country : $(input4.country), loyaltyFactor : $(input4.loyaltyFactor), totalPurchasesToDate : $(input4.totalPurchasesToDate), totalOrders : $(input5.totalOrders), noOfVisitsPerMonth : $(input30.noOfVisitsPerMonth)", "ErrorType": "Error", "localParams": [ { @@ -53,7 +53,7 @@ } ], "RuleExpressionType": "LambdaExpression", - "Expression": "input4.country == \"india\" AND input4.loyalityFactor >= 2 AND input4.totalPurchasesToDate <= 10 AND input5.totalOrders > 2 AND input3.noOfVisitsPerMonth > 5" + "Expression": "input4.country == \"india\" AND input4.loyaltyFactor >= 2 AND input4.totalPurchasesToDate <= 10 AND input5.totalOrders > 2 AND input3.noOfVisitsPerMonth > 5" }, { "RuleName": "GiveDiscount30", @@ -61,7 +61,7 @@ "ErrorMessage": "One or more adjust rules failed.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input4.loyalityFactor > 30 AND input4.totalPurchasesToDate >= 50000 AND input4.totalPurchasesToDate <= 100000 AND input5.totalOrders > 5 AND input3.noOfVisitsPerMonth > 15" + "Expression": "input4.loyaltyFactor > 30 AND input4.totalPurchasesToDate >= 50000 AND input4.totalPurchasesToDate <= 100000 AND input5.totalOrders > 5 AND input3.noOfVisitsPerMonth > 15" }, { "RuleName": "GiveDiscount35", @@ -69,7 +69,7 @@ "ErrorMessage": "One or more adjust rules failed, totalPurchasesToDate : $(input4.totalPurchasesToDate), totalOrders : $(input5.totalOrders)", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", - "Expression": "input4.loyalityFactor > 30 AND input4.totalPurchasesToDate >= 100000 AND input5.totalOrders > 15 AND input3.noOfVisitsPerMonth > 25" + "Expression": "input4.loyaltyFactor > 30 AND input4.totalPurchasesToDate >= 100000 AND input5.totalOrders > 15 AND input3.noOfVisitsPerMonth > 25" } ] }