Configuring a script step in workflow

  1. In the workflow diagram, add a Script step at the point where a script must be executed.
  2. Select the Script element from the workflow diagram.
  3. Specify this information in the properties pane:
    Name
    Specify a name for this workflow step.
    Description
    Specify a description for this workflow step.
    Script

    Select the script name to start. The scripts that are approved in ION Scripting and do not require input or output of type binary are listed.

    Click Details to see the script details in ION Scripting. Here you can also test the script.

    Click New to create a new script. The new script must be approved before it can be used in workflow.

  4. Click the Input Mapping tab to specify the input values for the script to be executed.

    The list of script input variables is displayed with their name and data type.

    For each mapping, you can specify a constant value as input, or a workflow parameter, or a workflow structure. You can omit input mappings, but at least one input mapping must be specified.

    1. To specify a constant value as input, select the Value column. Specify a value that is compatible with the data type of the script variable.
    2. To specify a workflow parameter as input, select the Workflow Parameter column. Select the parameter name from the drop-down list. Only workflow parameters that have compatible data types are listed.

      See the table that shows the data type compatibility for input mappings in Specifying details for a script element.

    3. To specify a workflow structure as input for a script variable of type String, select the Workflow Parameter column. Select the structure name from the drop-down list. At runtime, the structure elements are passed as a JSON string to the script.
    4. To omit an input mapping: select the Workflow Parameter column. Select the Ignore value option. At runtime, null is sent as input to the script.
  5. Click the Output Mapping tab to specify the mappings for the script results.

    The list of script input variables is displayed with their name and data type.

    For each mapping, you can specify a workflow parameter name to contain the value of the script output variable. Only workflow parameters that have compatible data types are listed.

    See the table that shows the data type compatibility for output mappings in Specifying details for a script element.

    To omit output mappings, select the Ignore value option. At least one output mapping must be specified.

    You cannot map a script output variable to a workflow structure.

  6. Click the Settings tab to specify how to handle errors from the script execution.
    1. Select the The workflow continues option to allow the workflow to continue to the next step in case of a script execution error. Optionally, you can collect the error response code and error message returned by the script:
      • Select the Error response code check box and select a workflow parameter of type String, Decimal or Integer.
      • Select the Error message check box and select a workflow parameter of type String
    2. Select the The workflow fails option to allow this workflow instance to fail in case of a script execution error.
  7. Click Save and activate the workflow.