O'Reilly logo

Drools JBoss Rules 5.X Developer's Guide by Michal Bali

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Validation

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" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required