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:
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.