Global variables and values are intended for sharing by all the rules of the module, and their life span covers the time the rule module is active (loaded) in the engine. When the module is loaded, these objects (variables and values) are created and initialized if there is any initialization statement. When BPM Events is shutdown and restarted, the following rules apply to global objects:
Global values ("val") are recreated and reinitialized.
Global variables ("var") are recreated, and reinitialized if applicable. If the variable is modified before shutdown, then its last value is not recoverable.
In some cases, this default behavior is not appropriate. For example, an application may expect the following behavior when recovering:
The latest value of a global variable should be recovered.
When a global variable holds a file descriptor resulting from an initial "openFile" statement, the file should reopen in "append" mode when recovering, in order to avoid erasing all previous data in the file.