Try OpenEdge Now
skip to main content
BPM Events User's Guide
The rule language : Predefined rule actions : Enabling and disabling rules
 

Enabling and disabling rules

When an application is installed, its main module is loaded and, with it, all the imported modules (import statement). It is also possible to load additional module files, or unload modules, using the BPM Events Admin utility. However, such procedures are usually intended for minor application upgrades, when a module requires reloading after some rule change.
Dynamically enabling and disabling rules is a business level operation. A group of rules usually implements such business functions as a monitoring option, a business policy, or a process control. In such cases, we want to enable or disable these functions at run-time, and do this as the result of a decision from other rules.
When a rule module is loaded (that is, when installing an application), all its rules are automatically enabled. It is then possible to disable some of the rules of the module. When some rules of this module are disabled, they remain loaded in the engine memory, but are "turned-off" so that they can no longer be triggered by any event. The logical behavior is the same as if the rule had not been loaded; it is "invisible" to events. When these rules are enabled again, they go back into the state they were in when first loaded: they are "turned-on" and responding again to events.
* enableRule(<application>, <module>, <rulename>)
* disableRule(<application>, <module>, <rulename>)