Understanding the Drools runtime instances
Drools allows us to create instances of the Rule Engine in different ways, so that we can choose which fits better to the problem that we are trying to solve. Each Rule Engine instance is an encapsulated context, where the rules that we define will be evaluated against the data that we provide to this particular instance. Historically, Rule Engines were seen as big and monolithic processes that run them in a server and we can send data to it to be processed. Drools, on the other hand, allows us to locally spawn lightweight instances to our application. It is common to have multiple instances dealing with different rules and data than just one big instance.
In order to spawn a new instance of the rule engine, we need to understand the following concepts:
- KieServices
- KieContainer
- KieModule
- KieBase
- KieSession
By using these five concepts, we will be able to define how each instance is configured and rules that will be available to each of them. In cases...