Teneo Developers

Flow Script

Introduction

Flow Scripts allows to execute scripts either when the Flow reaches the flow stack or when the Flow is dropped off the flow stack; Flow Scripts have access to both Global and Flow Variables.

  • On top Flow Scripts are executed when the Flow containing the script reaches the flow stack, either by being triggered or by regaining the top position after being interrupted by the triggering of another Flow
  • On drop Flow Scripts are executed when the Flow containing the script is dropped off the flow stack, either because the Flow has reached its end and is finished or because it becomes "stuck".

Remember, the scripting language in Teneo Studio is Groovy, and Teneo Studio provides basic support for syntax highlighting.

Add Flow Script

To add a Flow Script, follow the below steps:

  • With the Flow open, click the Flow tab to go to the backstage of the Flow
  • Select Scripts
  • Select if the script should be of type On top or On drop
  • In the script editor write the script syntax
  • Remember to Save the Flow to preserve the changes.

Open with... allows to select an external script editor to edit the Flow script, when scripts are edited in an external editor, the Flow's script editor is updated with the new, modified script ones the user saves the changes in the external editor, but the changes are not saved in the Flow until the user also clicks Save in the Flow.

Edit Flow Script

To edit a Flow Script:

  • With the Flow open, click the Flow tab to go to the backstage of the Flow
  • Select Scripts
  • Now, perform the needed edits in the On top and/or On drop script
  • Remember to Save the Flow to preserve the changes.

Open with... allows to select an external script editor to edit the Flow script. When scripts are edited in an external editor, the Flow's script editor is updated with the new, modified script ones the user saves the changes in the external editor, but the changes are not saved to the Flow until the user also clicks Save in the Flow.

Delete Flow Script

There is no Delete button available to remove an entire Flow Script. If the user needs to delete a script, the only option is to manually delete the script in the script editor, for example by highlighting the entire script expression and pressing Delete on the keyboard leaving the script editor empty.

Remember to save the Flow to preserve the changes.