
OpenRules “Rule DB” allows you to integrate your SQL queries into a rule-based decision management system. There are two integration methods:
- SQL Outside Rules (traditional)
- SQL Inside Rules (new)
Traditional Integration Schema (SQL Outside Rules)
Traditionally, when a rule engine is being integrated with a relational database, an application uses SQL to create intermediate objects extracted from the database (there could be millions of them) and invokes the rule engine in the loop or for the collections of such objects. Here is the traditional integration schema:

New Integration Schema (SQL Inside Rules)
RuleDB allows you to migrate to the new architecture without intermediate objects and both record selection and business logic being represented in the rules repository as shown on this schema:

You can migrate pure selection logic from an SQL query to an Excel-based table “DataSQL” and allows business analysts to concentrate on the business logic presented in the decision tables. The introductory example using the classic MySQL Sample Database is described here:

This example shows that without sacrificing power of SQL OpenRules allows you to naturally integrate business rules with a relational database. The migration of a more complex SQL query to business rules is described here. “RuleDB” examples are available in the standard OpenRules installation in the folder “openrules.db“.
