Business rules

Business rules are responsible for detecting the occurrence of events and predicting the time future events may occur. Event Manager uses the externalized rules component to configure the business rules.

The externalized rules component offers the following features:
  • Rules can be externalized into a rules engine.
  • Different rules engine products can be accommodated.
  • Different rules can be implemented in different rules engine products.
  • Rules can be externalized as Java™ code.
  • A rule can change implementation types (for example, rules engine implementation to Java code implementation and vice versa), without affecting the core product. In other words, a rule can have multiple implementations
  • A rule can receive input data and can return data in the form of objects

Most events must be predefined in the CDEVENTDEFTP table, except for events that are user explicit. When a business rule reports the occurrence of an event to Event Manager, a new record is created in the event table with a reference to the event definition. See Setting up event definitions and categories for Event Manager for details on how to set up the CDEVENTDEFTP table.

There is no direct relationship between events and rules. Events are detected by rules, and rules are executed because there are events defined in CDEVENTDEFTP table. The choice of rules engine can determine how many rules are needed to implement a single event. See Business rules for event definitions for information on how to associate business rules with event definitions.

Note: Rules are configured in tables related to the externalized rules component. Rules and event definitions are linked via EVENTDEFEXTRULE table, which references both the CDEVENTDEFTP table and the EXTRULE table. This means each event definition can have its own rule, if necessary. However, typically a single Java business rule can handle multiple event definitions. Similarly, a single rule set, configured as a single rule in the EXTRULE table, can handle all events defined in the CDEVENTDEFTP table. In this case, you must specify the same rule for all the event definitions it covers. Event Manager ensures the rule is executed only once, even if it is registered for multiple event definitions.