Try OpenEdge Now
skip to main content
BPM Events User's Guide
The rule language : Controlling the actions of a rule : Declaration action statements
 

Declaration action statements

Use the Declaration statements to declare and initialize identifiers (either variables or constants) to reuse in other actions. The general syntax for the declaration statement is:
<DeclarationStatement> ::=
        "val" <identifier> "=" <expression> ";" |
        "var" <identifier> "=" <expression> ";"
Identifiers declared with val cannot have their initial value changed later. They are constant values. An example is:
val blserver = getBLserver();
In this example, reuse order as a place holder in other action statements, but not as a new value. In the following example, rate is declared with an initial value of 0.5, but can be updated in future actions, for example, using an assignment of the form: rate := 0.6.
var rate = 0.5;
The scope of these identifiers is the smallest bloc {...} in which they are defined, usually the Action part of a rule, or the initialize or finalize section of a rule module.