* Add the generated jar `target/easyrules-core-${version}.jar` to your application's classpath
### Quick introduction
Most business rules can be represented by the following rule definition :
* Name : A unique rule name within a rules namespace
* Description : A brief description of the rule
* Priority : Rule priority regarding to other rules
* Conditions : Set of conditions that should be satisfied to apply the rule
* Actions : Set of actions to perform when conditions are satisfied
Easy Rules provides an abstraction for each of these key points that define a business rule.
### Easy Rules Key API
A rule in Easy Rules is an implementation of the `Rule` interface :
```java
public interface Rule {
/**
* Rule conditions abstraction : this method encapsulates the rule's conditions.
* @return true if the rule should be applied, false else
*/
boolean evaluateConditions();
/**
* Rule actions abstraction : this method encapsulates the rule's actions.
* @throws Exception thrown if an exception occurs during actions performing
*/
void performActions() throws Exception;
//Getters and setters for rule name, description and priority omitted.
}
```
The `evaluateConditions` method encapsulates conditions that must evaluate to TRUE to trigger the rule.
The `performActions` method encapsulates actions that should be performed when rule's conditions are satisfied.
Easy Rules provides a simple implementation of the `Rule` interface named `BasicRule`. This class implements most of methods
defined in the `Rule` interface. To define a rule, you can extends this class and override `evaluateConditions` and
`performActions` methods to provide your conditions and actions logic.
Evaluating conditions and performing actions should be delegated to other objects if used across multiple rules.
### Easy Rules engine
Easy Rules engine handles a registry of rules with unique names. Each instance of Easy Rules engine can be seen as a separate namespace.
Rules are applied according to their priorities. By default, lower values represent higher priorities. To override this default behavior, you can extend the `BasicRule` class
and override `compareTo` method to provide a custom priority strategy.