Execute Rules
Verb: executeRules
Available from: <Enterprise>
Executes a set of rules formed by a context of conditions.
Syntax
executeRules --label(String) [--debug(Boolean)]
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--label | Rule Set | Required | Text | Name of the rule set that should be executed. |
--debug | Debug Rules | Optional | Boolean | When enabled, allows debugging within the rule set context. |
Example
The Execute Rules command runs a set called "exampleRule", started by Begin Rules. The Exclude Rule command is used to exclude "Rule A". Thus, after the execution of "Rule B", "Rule A" is no longer used.
defVar --name secondValue --type Numeric --value 20
defVar --name firstValue --type Numeric --value 10
defVar --name ruleExampleB --type Rule
defVar --name ruleExampleA --type Rule
executeRules --label exampleRule
beginRules --name exampleRule
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" ruleExampleB=output
when --left "${firstValue}" --operator "Equal_To" --right 15
then
excludeRule --rule ${ruleExampleA}
setVar --name "${firstValue}" --value 60
endCase
endRules
Remarks
This command only works outside a rules context started by the Begin Rules command, as it is used to execute a rule created within that context.