Rule templates

Rule templates in Drools are a way to generate DRL rules on-the-fly using template files and tabular data sources. By tabular data sources, we mean data that can be expressed in a table. Typical examples of this kind of data source are spreadsheets and tables in databases.

Probably one of the most common questions in Drools mailing lists and forums is how to generate rules from data that is stored outside our application. The typical case is data inside a database. One of the ways to deal with this scenario is by using rule templates.

Another great advantage of rule templates is that the data and the structure of the rule are completely decoupled. The same template can be used for different data sets and the same data set can be used ...

Get Mastering JBoss Drools 6 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.