rezaarshad / grules

Grules - rule engine for data preprocessing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grules is a rule engine for data preprocessing. The rules are specified via internal Groovy DSL, which has a concise and simple syntax. For example:

// isEmail is a Groovy/Java method that takes an email value as its parameter
email isEmail ["Invalid email"]

// invalidLoginMessage and dupLoginMessage are String error messages
login isLogin [invalidLoginMessage] >> isUnique [dupLoginMessage] 

// The value gender defaults to "MALE"
gender["MALE"] toEnum(Gender) 

// agreeToTerms is a message from a resource bundle
termsCondition[""] !isEmpty [m.agreeToTerms] 

// you can use closures as well
weight toPositiveBigDecimal [decimalErr] >> {round(it / 1000)} 

// Grules supports logical operators 
endDate isAfterNow && isBefore(deadline) && {it.day != 1}

To build the project, you should run the following command in the grules folder:

cd grules
./gradlew

To run hello world example:

cd grulesHelloWorld
./gradlew

Documentation:

Wiki documentation
White paper
Introduction video

Requirements: JVM 8, Groovy 2.3

About

Grules - rule engine for data preprocessing

License:MIT License


Languages

Language:Groovy 90.1%Language:Java 5.7%Language:CSS 4.2%Language:JavaScript 0.1%