In this recipe, you will see how to configure the Drools business rules engine using the Spring framework, using the integration module specially created to configure the Drools beans with XML.
Carry out the following steps in order to configure a Drools project using the Spring Framework integration:
Add the following dependency in your Maven project by adding this XML code snippet in the
pom.xml
file:<dependency> <groupId>org.drools</groupId> <artifactId>drools-spring</artifactId> <version>5.2.0.Final</version> </dependency>
Once the
drools-spring
module and the Spring Framework dependencies are added into your project, it's time to write the rules that are going to be included in the knowledge base. This recipe uses the same rule that was used in Chapter 1, shown as follows:package drools.cookbook.chapter07 import drools.cookbook.chapter07.model.Server import drools.cookbook.chapter07...