Try OpenEdge Now
skip to main content
BPM Events User's Guide
The rule language : Rule modules and rule groups : Rule modules of an application : Rule module and name scope
Rule module and name scope
The rule module usually represents a set of rules that implement a logical unit of the application. Several modules are required when writing a large application. The module also serves another purpose: it is a name scope for the rule names. A rule name must be unique inside its module, but does not have to be unique across modules of the same application: conflict does not occur between rule r1 in module A and a different rule r1 in module B, when loaded together.
The general structure of a rule module is:
application <app_name>
module <module_name>
[import <gen_module_name> ( "," <gen_module_name> )* ";" ]
group <group_name> "{" ... "}"
( rule <file_name> "{" ... "}" )*
[ [ initialize ] "{" <action_list> "}"]
[ [ reinitialize ] "{" <action_list> "}"]
[ finalize "{" <action_list> "}"]
The imported modules above may be given only their name, or an application-qualified name if they belong to another application:
<gen_module_name> ::=
    <app_name> "::" <module_name>
In the syntax above, the symbols <>, ()*, and [] have the following meaning, similar to their role in conventional regular expressions:
*<> denotes an application-specific name
*(...)* denotes "repeat expression 0 or more times"
*[...] denotes "optional expression". Note that initialize and finalize sections are optional
In the current version of BPM Events, a rule file comes in two formats:
*The text rule file, which contains rules written in the format described in this document, and has the suffix ".txt" (for example, myApp_rules.txt) or ".bps" (for example, my App_rules.bps).
*The compiled rule file, which contains a compiled, ready-to-load version of the rules. Such files have the suffix ".bpo", as they are coded in a particular format. The compiled version of the previous example is myApp_rules.bpo.