compute
The compute agent computes field values based on expressions evaluated at runtime. If the field already exists, it will be overwritten.
Example
Given the input:
With an agent configuration of:
The output would be:
Topics
Input
Output
Configuration
Field
Field type
Expression Language
To support Conditional steps and the Compute Transform, an expression language is required to evaluate the conditional step when
or the compute step expression
. The syntax is EL, which uses the dot notation to access field properties or map keys. It supports the following operators and functions:
Operators
The Expression Language supports the following operators:
Arithmetic: +, - (binary), *, / and div, % and mod, - (unary)
Logical: and, &&, or, ||, not, !
Relational: ==, eq, !=, ne, <, lt, >, gt, <=, ge, >=, le.
Functions
Utility methods available under the fn
namespace. For example, to get the current timestamp, use fn:now()
. The Expression Language supports the following functions:\
Conditional Steps
Each step
accepts an optional when
configuration that is evaluated at step execution time against current records (the current step in the transform pipeline).
The when
condition supports the expression language syntax, which provides access to the record attributes as follows:
You can use the .
operator to access top level or nested properties on a schema-full key or value.
For example, key.keyField1
or value.valueFiled1.nestedValueField
.
Configuration
Checkout the full configuration properties in the API Reference page.
Last updated