Open source Java™ rules engine.
Easy rules provides a simple API to get you up and running quickly.
2 minutes tutorial →Then, fire it!
public class Test {
public static void main(String[] args) {
// create a rules engine
AnnotatedRulesEngine rulesEngine =
new AnnotatedRulesEngine();
//register the rule
rulesEngine.registerRule(new MyRule());
//fire rules
rulesEngine.fireRules();
}
}
First, define your rule..
@Rule (name = "my awesome rule" )
public class MyRule {
@Condition
public boolean when() {
return true;
}
@Action
public void then() {
System.out.println("Easy Rules rocks!");
}
}
Easy Rules is open source, hosted on GitHub and is released under the terms of theMIT License.
Many thanks to YourKit, LLC for providing a free license of YourKit Java Profiler to kindly support the development of Easy Rules.