Rules Manager in Oracle 10g Database Release 2

Oracle 10g Release 2 introduced the Rules Manager to enable improved event-based processing. For those not familiar with state-event processing, this type of functionality can seem a little obscure, but it allows you to loosen the relationship between object creation and the decision on how to process the resulting object. As such, many of the changes to the processing decisions can be data driven, rather than requiring code changes for the slightest alteration. Oracle have dedicated whole manual dedicated to the rules manager, so the example in this article is merely scratching the surface of the functionality.

Next, we create a rule class using the event structure defined previously. In addition, we define the name of a callback procedure along with some optional action preferences necessary. These action preferences may be necessary for the event processing, or simply additional information.

We now have a functional callback procedure to process the events, we need to specifiy which events should need to be processed. This is done by inserting rows into the rule class table. This is the data-driven element of the decision process, since amending the rows in the rule class table affects the decision process. We only want to process events for cars that are red or manufactured by Ford. The insert statements below create the appropriate rules.