In a module, global variables and values are intended for sharing by all the rules of the module. Their life span covers the time the rule module is active (loaded) in the engine. Global variables and values are declared immediately after the "module" statement, and before the first rule group. You can initialize them in the same declaration statement. In the following example, the value: file_name is initialized to a file path, and cannot be modified later (declared as "val"). The variable mycounter (declared as "var") is initialized with "1", and can be modified later by any rule.
application BP_test_suites
module test_util
val file_name = "e:\\obms\\log\\test_util.log";
var mycounter = 1;
When recovering, the rule engine reloads the module with specific behavior that ensures the initialize{} section is not executed again. Also, all global variables are recreated and reinitialized.