Conditions and expressions
Conditions represent event definitions, and they outline the circumstances under which a job can be completed. A condition is a recursive data type that allows for multiple conditions within it, all of which need to resolve to true for the Job to allow execution. This complex data type includes several underlying types. For more general information on conditions, visit the concepts section. To view an example of a condition message, visit the Example page. For information about conditions in templates, visit the template tutorial.
Conditions can be either a single expression, or they can be nested and chained using regular boolean operators, such as And
, Or
, or Not
.
Expressions
Expressions contain comparisons of popular data types, such as integers, unsigned integers, timestamps, booleans, strings, and more.
Values
A value is the simplest type of input used in an expression. In double-sided general expressions, the value can either be a primitive type or a query that gets a primitive type.
General expressions
General expressions or GenExpr
are used to compare two values using a:
The operators of general expressions vary depending on the value type.
Only values of the same Type
can be compared when writing an expression.
String operators
The following operators are used in general expressions when comparing strings.
Number operators
The following operators are used in general expressions when comparing integers or decimals.
Time expressions
Time expressions are like regular unsigned integer expressions, except they only contain a left value and an operator. The right value is filled by a BlockHeight
or Timestamp
, depending on the value type.
Time operators
Time operators can be greater than or less than a specified time.
Blockheight
Blockheights can be specified as a Unit64
and a number operator.
Queries
Queries can be used in expressions as variables. For more information on queries, visit the Query page.
Bool
Queries can also be written as boolean expressions, in which a [query selector] is evaluated as a boolean.