Try OpenEdge Now
skip to main content
BPM Events User's Guide
The rule language : Rule structure

Rule structure

Rules are triggered by events pushed to BPM Events. Rules are composed of an event header, a Condition part or if clause (optional), and an Action part or then clause. The general form of a rule is:
rule <rulename>
activated by <event headers>
[if <conditions>]
then "{" <actions> "}"
The general meaning of such a rule is:
"on reception of the specified events: if these events satisfy the conditions, then execute the actions."
The detailed syntax of a rule is as follows (for a more formal syntax specification, please refer to the language syntax in Rule syntax):
*Rulename — A string of characters with no space in it.
*Event header — A list of one or more events, identified by variables, that can trigger—or activate—the rule. If a single event is mentioned, then it means the rule is triggered each time such an event is notified to BPM Events. If more than one event types are mentioned in the header, then the rule triggers for each combination of such events. Combinations of events require access to past events. Each event type in the header is generally specified as:
<evt variable> of <evt type>::<evt subtype>{activation filter}
For example, the event sent on completion of a Business Process Server process instance specifies as:
*Conditions — Specified in the optional if clause. This is a logical expression that describes additional selection condition(s) on the type(s) of event(s) described in the event header. The conditional expression may combine several simple conditions with the logical connectors and, or and not. If the conditions are satisfied for some incoming event(s), then the rule is said to be successfully triggered.
*Actions — The Actions part is a list of actions of possibly very diverse nature: call an external program, send an e-mail, generate a new event—either for internal or external use through an event adapter, update a monitoring report, enable/disable rules, etcetera. It executes only if the conditions are satisfied, that is, if the rule is successfully triggered.
* Syntactical conventions and limitations
* Event variables and expressions
* Common variables, constants, and their scope
* Rule condition as a logical expression
* Priority and parentheses
* Relational expressions and operands
* Comments in rule language