property
The property keyword declares a rule, ruleset, or ruleflow property.
Purpose
This keyword is used to declare specific properties for a rule, a ruleset, or a ruleflow in a rule file.
Context
Rulesets, ruleflows, and rules
Syntax
property propertyName = value;
Description
The propertyName argument is any identifier and value is of type String.
You can use the property keyword at two levels: the ruleset level and the individual rule level.
At ruleset level, the property declaration must appear after the import statement.
At rule level, the property declaration is part of the rule header.
Users can declare properties at both the ruleset level and the rule level.
As a ruleflow property, this property is used to define a user property on the task. The engine does not interpret this property. You can retrieve its value later by using the API.
Example
The first example shows a ruleset property. The second example shows a rule property.
- Example 1
When used at the ruleset level, as in this example, the property keyword is enclosed by a declaration that begins with the word ruleset, followed by any identifier. Two user-defined properties store the first and last names of the ruleset author.
ruleset Vacation { property authorlastname = "Brans"; property authorfirstname = "Sue"; }- Example 2
When used at the rule level, the property keyword is part of the header declarations. A user-defined property declares the date at which the rule was last changed. Note that the value is of type String.
Rule CdUpdate { priority = 100; property lastChangeDate = "22 02 06"; when { ...