Skip to content

vijayparashar12/RuleEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rule Engine

  • Actionable Rules based on custom parameter.
  • Based on infix expression evaluation.
  • Extensible with simple DSL for new operator definition.

Sample Rule

{
  "lhs": "$price",
  "op" : "GTE",
  "rhs": "200"
}

every rule evaluation return boolean result.

Complex Rule

{
    "lhs": {
        "lhs": "$price",
        "op": "GTE",
        "rhs": "200"
    },
    "op": "AND",
    "rhs": {
        "lhs": "$inventory",
        "op": "GT",
        "rhs": "100"
    }
}

DSL allows custom operators to be included in rule engine based on requirements.

Actionable Rules

If a rule is evaluated to be true then action is preformes , other wise execution of the action is skiped.

{
	"rule": {
		"lhs": "$price",
		"op": "GTE",
		"rhs": 1000
	},
	"action": {
		"result": {
			"lhs": "$price",
			"op": "DISCOUNT",
			"rhs": 10
		}
	}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages