Value sets and ranges
- Last Updated: June 28, 2022
- 3 minute read
- Corticon
- Version 7.2
- Documentation
Value sets
When you define values for a condition or an action spanning multiple
rule columns, you build a value set. A value set is a set of distinct values for a
condition or an action. For example, in the following image, the condition
Aircraft.aircraftType has two values in its value set. The action
Aircraft.maxCargoWeight also has two values in its value set. As you
build a value set by defining values across different rule columns, each cell in the
same row becomes a drop-down list when you click it, displaying all the values that you
enter in the value set.
How to use other in a condition value set
Other is a special type of operator that helps you recognize that other values may be unaccounted for, and gives you a simple way to detect them in rules. You can think of it as the operator that provides the ELSE clause of an IF-THEN-ELSE rule. It is available only for value sets that you build in Condition rows.
You can enter other as a cell value. It is not a String
value, so single quotation marks are not required.
After you enter three values for a condition’s value set, a value named other is added to the list of choices in the drop-down list, as shown in this image.
In this example, the value set for
Aircraft.aircraftType has three values—'747',
'777', and '787'. However, if data is received with
an aircraft type outside this value set, you can choose other in a rule that sets
the maximum cargo weight of any aircraft that is not a 747, 777, or a 787.
Value ranges
A common requirement while defining rules is to specify conditions that
check for a range of values in a single rule column cell. For example, a rule that
checks if the cargo volume is between 1000 and 2000 (a range of values), and assigns a
container type. You specify a range of values by entering the starting value, followed
by two dots or periods, followed by the ending value—for example
1000..2000—as shown in the image.
Enclose the value range in parentheses or square brackets as follows:
|
Syntax example |
Description |
1000..2000
|
No square brackets or parentheses specifies a range between 1000 and 2000 and includes the values 1000 and 2000. |
(1000..2000)
|
Enclosed in parentheses specifies a range between 1000 and 2000, but excludes the values 1000 and 2000. |
[1000..2000]
|
Enclosed in square brackets specifies a range between 1000 and 2000 and includes the values 1000 and 2000. |
(1000..2000]
|
An opening parenthesis and a closing square bracket specifies a range between 1000 and 2000, excludes 1000, but includes 2000. |
[1000..2000)
|
An opening square bracket and a closing parenthesis specifies a range between 1000 and 2000, includes 1000, but excludes 2000. |
1000..2000) results in an error.