The OpenRulesTM Tutorials Home TOC | User's Guide |
Using Databases as OpenRules Repositories
4Simple DB-based Rules Repository
4Database Structure
4Example "HelloJava" for Java Derby DB
4Database Configuration File
4Database Administration Interface
4Example "RulesRepositoryDB"
4DB-based Rules Repository with Version Control
4Database Structure
4Repository Versioning Concept
4Example "RulesRepositoryDBV"
4Maintaining Multiple Repository Versions
4Database Administration Interface with Versioning
4Custom DB ProtocolsAlong with rules repositories organized as a hierarchy of Excel files, OpenRules allows you to use standard relational databases to keep and maintain your business rules. To do this, you may place your Excel files with OpenRules tables into any relational database as Blob objects. OpenRules provides a direct access to Excel files saved in a database without necessity to download them into a file system. OpenRules supports several protocols that handle DB-based rules repositories:
Simple DB protocol "db:" - this protocol supports one table in which all Excel files are saved as Blob objects with unique keys that usually correspond to relative paths of these files in a file system. It supports a very simple protocol "db:<filepath>" such as "db:/hello/rules/include/HelloRules.xls"
Versioning DB protocol "dbv:" - this protocol additionally to the features provided by the simple DB protocol allows a user to maintain different rules versions and provides checkin/checkout facilities. It supports the protocol "dbv://<repository>:<version>/<filepath>" such as "db://rules:25/include/DiscountRules.xls".
Custom DB protocol with any user-defined name. A user can customize the standard OpenRules protocols to take into consideration specifics of their databases - only modifications in a configuration file "db.properties" are required. The user also may create and register their own db-protocol implementations using the OpenRules source code as an example. OpenRules allows users to register many custom protocols without changes in OpenRules code itself.
The standard DB protocols come with sample projects that explain how to use these protocols to maintain DB-based rules. They also demonstrate how tune the protocols to work with different JDBC databases or with the standard open source Apache Derby database. OpenRules also provides basic DB administration facilities to create and maintain Excel-based rules in a database.
►top