Inline
Inline tasks enable the execution of essential logic during workflow runtime by evaluating a JavaScript expression using an evaluator like GraalJS.
Definitions
{
"name": "inline",
"taskReferenceName": "inline_ref",
"type": "INLINE",
"inputParameters": {
"expression": "(function () {\n return $.value1 + $.value2;\n})();",
"evaluatorType": "graaljs",
"value1": 1,
"value2": 2
}
}
Input Parameters
Attribute | Description |
---|---|
expression | Specifies the JavaScript expression to be evaluated by the GraalJS evaluator. |
evaluatorType | Supports GraalJS evaluator. |
Script params | Provide the parameters for evaluating the script. Any properties can be accessed as $.value for the expression to evaluate. |
Output Parameters
Attribute | Description |
---|---|
result | Returns the results of the evaluated script. |
Examples
- UI
- JSON
- Add task type Inline.
- Write the inline ECMAScript.
{
"name": "inline",
"taskReferenceName": "inline_ref",
"type": "INLINE",
"inputParameters": {
"expression": "(function () {\n return $.value1 + $.value2;\n})();",
"evaluatorType": "graaljs",
"value1": 1,
"value2": 2
}
}
info
The JSON definition provides a concise string representation of the script. In contrast, the UI representation typically includes formatted indentation and line breaks for better user readability.