The simple, stupid Java™ rules engine

Then, fire it!

public class Test {
    public static void main(String[] args) {
        // create a rules engine
        RulesEngine rulesEngine =
                            aNewRulesEngine().build();
        //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!");
    }
}

Latest news

24/08/2016: Version 2.3 has been released with new features and bug fixes. See change log here.

07/12/2015: Version 2.2 is here with meta-annotation support! See all changes in detail here.

28/06/2015: Version 2.1 is out with Spring and Quartz support. Check what's new here.

21/05/2015: Version 2.0 is finally released! checkout what's new here.

License

Easy Rules is open source, hosted on GitHub and is released under the terms of the MIT License.

Credits

Many thanks to YourKit, LLC for providing a free license of YourKit Java Profiler to kindly support the development of Easy Rules.

Many thanks to Travis CI for providing a free continuous integration service for open source projects.