Basic operators
Description of general operators used in decision tables
List of Basic Operators
Each condition cell in the decision table allows you to select a different operator. Below is an example of some available basic operators:
Input values (left operands) are auto-casted to the necessary data type, and right-side operands are also auto-casted. No quotes are needed in table values.
Equals (=
)
=
)Compares scalar values like strings, numbers, and booleans.
Anything (ANY
)
ANY
)The Anything operator is the simplest operator available in decision tables. It always returns true
, regardless of the input. This operator is typically used in cases where a condition needs to pass for every possible input value, or where the specific value is irrelevant to the rule’s outcome.
The Anything operator does not perform any comparison; it simply returns true
for any input.
The operator is useful in scenarios where you want a rule to be triggered without considering the specific content of the condition.
Is in (IN
)
IN
)Returns true
if the left operand is in the right operand's set, which must be an array. Members of the set can be separated by pipe (|
), comma (,
), semicolon (;
)
Only exact matches.
Not in (!IN
)
!IN
)Returns true
if the left operand is not in the right operand's set. Members of the set can be separated by pipe (|
), comma (,
), semicolon (;
)
Greater than or equal (>=
)
>=
)Compares numbers or strings; returns true
if the left operand is greater than or equal to the right operand.
Numbers can be decimal or integer.
String comparison is similar to JS.
Greater than (>
)
>
)Returns true
if the left operand is greater than the right operand.
Numbers can be decimal or integer.
String comparison is similar to JS.
Less than or equal (<=
)
<=
)Returns true
if the left operand is less than or equal to the right operand.
Numbers can be decimal or integer.
String comparison is similar to JS.
Less than (<
)
<
)Returns true
if the left operand is less than the right operand.
Numbers can be decimal or integer.
String comparison is similar to JS.
Not equal (!=
)
!=
)Compares scalar values and returns true
if they are not equal.
Between (BTW
)
BTW
)Returns true
if the left operand is between or equal to the two values specified in the right operand, which must be an array of two values. This operator can be used to compare Numbers, Strings, or Booleans.
The operator evaluates whether the left operand falls within the inclusive range defined by the two values in the right operand array.
The left operand can be a number, string, or boolean, and the right operand must be an array of two values.
Between left open (BTW LO
)
BTW LO
)Returns true
if the left operand falls within the range defined by two values in the right operand, excluding the lower limit (left value) and including the upper limit (right value). If the left operand is equal to the lower limit, the result will be false
.
The left operand can be a number, string, or boolean, and the right operand must be an array of two values.
Between right open (BTW RO
)
BTW RO
)Returns true
if the left operand falls within the range defined by two values in the right operand, including the lower limit (left value) and excluding the upper limit (right value). If the left operand is equal to the upper limit, the result will be false
.
The left operand can be a number, string, or boolean, and the right operand must be an array of two values.
Not between (!BTW
)
!BTW
)Returns true
if the left operand does not fall within the range defined by two values in the right operand. This operator effectively checks if the left operand is outside the specified interval.
The left operand can be a number, string, or boolean, while the right operand must be an array containing two values.
Is null (NULL
)
NULL
)Returns true
if the value being evaluated is empty. It does not accept any specific table values for comparison.
The request value is checked against various types of empty values.
This operator is useful for validating whether a value has been provided or is absent.
Is not null (!NULL
)
!NULL
)Returns true
if the value being evaluated is not empty. It does not accept any specific table values for comparison.
The request value is assessed to determine if it holds any non-empty data.
This operator is useful for confirming that a value has been provided or exists in the dataset.
Contains text (C TXT
)
C TXT
)The operator checks if the left operand includes any of the values specified in the right operand, returning true
if a match is found and false
otherwise.
The operator matches not only exact values but also substrings.
Members of the set can be separated by pipe (
|
), comma (,
), or semicolon (;
).The left operand can be of type Number, String, Boolean, or an Array containing these types.
This operator is particularly useful for scenarios where partial matches or the presence of specific elements within a collection need to be identified.
Contains in (C IN
)
C IN
)Returns true
if any of the values in the right operand are present in the left operand. This operator checks for both exact matches and substrings, returning false
if no match is found.
The operator matches not only exact values but also substrings.
Members of the set in the right operand can be separated by pipe (
|
), comma (,
), or semicolon (;
).The left operand can be a Number, String, Boolean, or an Array of these types.
This operator is effective for verifying the existence of one or more elements from a list within a string or array.
Not contains in (!C IN
)
!C IN
)Returns true
if none of the elements in the right operand are present in the left operand. This operator checks both exact values and substrings, returning false
if any match is found.
Members of the set in the right operand can be separated by pipe (
|
), comma (,
), or semicolon (;
).The left operand can be a Number, String, Boolean, or an Array containing these types.
It returns
true
only when there are no matches found.
This operator is useful when you want to confirm that none of a given set of elements is present in a string or array.
Equal array (EQ ARR
)
EQ ARR
)Returns true
if all the values in the right operand are substrings of at least one of the values in the left operand. This operator checks for matches within the elements of the left operand array, ensuring that all specified values in the right operand appear as substrings.
The right operand set can be separated by pipe (
|
), comma (,
), or semicolon (;
).The left operand must be an array
[]
.It returns
true
only when all the values in the right operand match a substring in the left operand.
This operator is helpful when you want to ensure that a set of substrings is found across an array of values.
Else (ELSE
)
ELSE
)The ELSE operator is a unique operator in decision tables, which returns true
when no preceding row has passed the evaluation. It acts independently of the input variable in its column and only evaluates the overall flow of the table rather than specific conditions.
Key Points:
The ELSE operator triggers if no other rows have passed before it.
There can only be one row with the ELSE operator that passes.
When evaluated, it takes into account only the conditions above it in the table.
The ELSE operator is primarily used to create a default or fallback row in decision tables. This row is triggered if no other conditions match, making it ideal for handling scenarios like generating error messages or returning default responses.
Last updated