Rule sets are a convenient way to separate your business rules into different collections.
Doing so increases the rules' maintainability because of a better organization and fully uncoupled rules.
Tip
Rule sets are very usefull when you have a lot of rules.
Info
Most of the time, you won't need to handle different rule sets and will only use the default one: default_rule_set.
The good news is that different rule sets can be used seamlessly with the same rules engine instance
Let's take the following example:
Based on that example, imagine that you need to add some rules about something totally different than the superhero school. Let's say rules for a dinosaur school.
Configuration
Update your configuration by adding a new rule set: dinosaur_school_set
You can define your rule sets into different YAML files (under the rules key in each).
Usage
Now that your rule sets are defined (and assuming that your condition and action functions are implemented in the right modules), you can easily use them: