Ana içeriğe geç

Script

Where the custom logic lives. Scripts are Groovy, and a workflow's Script node runs one.

Script

The script list. Custom scripts were written here; System scripts were imported.

The list

ID, Name, Type and Description, with created and updated columns available under Columns.

Type tells you where a script came from - Custom if it was written here, System if it was imported. Imported scripts open read-only.

Writing one

Create opens an editor tab. Write Groovy on the left; Input and Output panes sit below, and you can drag the split to resize them.

The input you type is available to your code as gtInput.

Run executes the script against that input and shows the result in Output. Nothing is saved by running.

Snippets

The snippets menu inserts working code rather than leaving you to remember an API. The groups are:

GroupWhat it covers
Groovy UtilsParsing and building XML and JSON
ConvertersEDI to XML and back
LoggersSuccess, warning and failure logging, with or without a payload
BID utilsReading and setting business IDs
Global VariableReading the workflow's global variables
LookUp UtilitiesReading and writing lookup tables
GT UtilsCalling a map, another script, an adapter, or a partner network
Send EmailSending mail, with or without attachments
GT PropertiesReading configured properties

Script Variables

Declares the values the script expects. A workflow's Script node then maps each one to a global variable or a fixed value - so the same script serves several workflows.

Saving and importing

Save and Save As write into the User Object folder. Import takes an existing .groovy or .gtScript file from Resources.