Skip to content

Latest commit

 

History

History
48 lines (41 loc) · 1.16 KB

README.md

File metadata and controls

48 lines (41 loc) · 1.16 KB

RuleEngine

Use this project as library add this to your project and create rule in json format in database which will be used by RuleEngine.

call Excute method in RuleProvider and pass request object on which you want to apply rule. in return you will get the action need to perform if the rule get satisfied.

Example Json format : { "corpId": 1020195, "schemeId": 0, "ruleSets": [{ "filter": { "fromState": 0, "toState": 7, "ruleExpression": [{ "propertyName": "Amount", "operation": "GreaterThan", "value": "1000" }] }, "action": { "sendEmail": true, "toEmailHashSet": ["[email protected]"], "ccEmailHashSet": null, "bccEmailHashSet": null, "EmailTemplateId": 1, "AttachmentHashSet": null, "letterId": 1, "sendSMS": false, "contactNoHashSet": null, "SmsTemplateId": 0 } }] }

Example request object: Request request = new Request(); request.Amount = 11000; request.ToState = 1; request.CorpId = 1; request.CustomerContact = "1111111111"; request.CustomerEmail = "[email protected]";

var result = RuleProvider.Instance.Execute(request); // will call the Rule engine and get the action mention in json if filter get satisfied