Skip to content

prithvianilk/whomping-willow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

whomping-willow

whomping-willow is a platform that allows you to create, edit and maintain complex conditional based actions and business rules in the form of decision trees.

Features

  • Create decision nodes supported by predicates that are evaluated at runtime.
  • Create value nodes as final results of the tree evaluation.
  • Link nodes to create powerful decision trees.
  • You can provide input parameters used to evaluate the decision tree at runtime.
  • Also, rust gang gang.

whomping-willow as a platform

  • User can CRUD on DTs.
  • Each DT also has context, that can be updated or fetched externally from another service.
  • This will allow for use cases, where we don't have context data stored but it is managed in another system.
  • For a DT, a predicate should be constructed with an lhs and an rhs.
  • lhs will be data received during evaulation via input parameters supplied.
  • rhs will be constructed using context for the DT.
  • lhs and rhs can be constructed using a serde_json's pointer notation.

Example:

input params:

{ "monthly_income": 30000 }

context:

{
    "account_details": {
  	  "min_monthly_income": 20000
    }
}

You would create your predicate with paths as following.

lhs: /monthly_income

rhs: /account_details/min_monthly_income

Predicates

  • LTNumber: Checks if lhs < rhs (both are numbers)
  • GTNumber: Checks if lhs > rhs (both are numbers)
  • EQNumber: Checks if lhs = rhs (both are numbers)
  • EQString: Checks if lhs = rhs (both are strings)
  • InListOfString: Checks if lhs is in rhs (lhs is a string, rhs is a list of strings)

An example decision tree for a bank application

Screenshot 2023-07-01 at 12 45 22 PM

TODO

  • Make it non domain specific, use json path
  • Make it a platform? Allow creation of mutliple DTs, with context
  • Add a nice JSON editor

About

Decision tree creation and evaluation platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published