O'Reilly logo

Drools JBoss Rules 5.0 Developer's Guide by Michal Bali, Bogdan Brinzarea

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

Spring Framework integration

Drools, as of version 5.0 doesn't provide out of the box integration with the Spring Framework. It is planned to be included in version 5.1+.

In this section, we'll perform our own integration.

KnowledgeBaseFactoryBean

We'll define the Spring FactoryBean for creating KnowledgeBase. The bean will be called KnowledgeBaseFactoryBean. It will take a list of Spring resources and will build a knowledge base out of them. We've already seen the usage of this bean in Chapter 9, Sample Application where we created the validation knowledge base. To refresh our memory, here is another example that creates a loan approval knowledge base:

<bean name="loanApprovalKnowledge" class="droolsbook.integration.spring.KnowledgeBaseFactoryBean"> ...

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