Begin Rules
Verb: beginRules
Available from: <Enterprise>
Begins a rule set context.
Syntax
beginRules --name(String)
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--name | Name | Required | Text | Name of the rule set context that should be initiated. |
Example
The Begin Rules command begins the rule set "ruleExample", using the Exclude Rule command to exclude "ruleA". Thus, after the execution of "ruleB", "ruleA" is no longer used.
defVar --name secondValue --type Numeric --value 20
defVar --name firstValue --type Numeric --value 10
defVar --name ruleExampleA --type Rule
// Change the value from 10 to 60 of the variable "firstValue", within rule B, and exclude rule A.
executeRules --label ruleExample
beginRules --name ruleExample
case --name "Rule A" --switches "CaseSwitchesAll" ruleExampleA=output
when --left "${firstValue}" --operator "Equal_To" --right 10
when --left "${secondValue}" --operator "Equal_To" --right 20
then
setVar --name "${firstValue}" --value 15
endCase
case --name "Rule B" --switches "CaseSwitchesAll"
when --left "${firstValue}" --operator "Equal_To" --right 15
then
excludeRule --rule ${ruleExampleA}
setVar --name "${firstValue}" --value 60
endCase
endRules
Remarks
A rule set context starting with Begin Rules always ends in End Rules.
The commands that can be used within a rule set context are: