In this section we'll describe the validation slice of this application (from bottom to top) that includes a definition of validation knowledge base, validation service, and the user interface.

We already have the validation service implementation. We'll now configure it with Spring. The first step is to build the validation knowledge base that will be used by the validation service. It will be managed by Spring like any other bean. The configuration goes into the applicationContext.xml file.

Fortunately, Drools does integrate with Spring out of the box. It provides its own namespace. The validation knowledge base can be defined like this:

<drools:kbase id="validationKnowledge"> <drools:resources> <drools:resource type="DRL" source="classpath:validation.drl" ...

Get Drools JBoss Rules 5.X Developer's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.