Script Task

script task

A Script task is used only in executable models, where it computes a value using a user-specified FEEL literal expression.

Task Configuration

The Script task may have multiple task inputs, and the expression computes a single task output. The task inputs and task output are defined by the modeler in Data Mapping.

Configuration of a script task has 3 parts:

  • The input mapping defines the task inputs and their mapping from process variables.

  • The script expression maps the task inputs to the task output.

  • The output mapping defines the task output name and type, and maps it to process variables.

Task Inputs

The Script task inputs are defined by the modeler in the first column of the Mapping section of the data input mapping. Here they are tradeType, value, and cash balance. The Mapping expression can reference only process variables listed in the Context section.

script inputs

Task Output

The Script task output is named by the modeler in the Context section of the data output mapping. Here it is called Error list, a Collection of Text. The Mapping section maps the task output to a process variable, also called Error list.

script output

Script Expression

Clicking Attributes/Script from the task context menu lets you enter a FEEL expression mapping the task inputs to the task output.

script expression

In this case, the expression references all three task inputs to generate the output value.