Workflow Gosu

Workflow elements Start, Finish, Enter, Exit, GO, TRIGGER, and TIMEOUT can all contain embedded Gosu. The Workflow engine executes this Gosu code any time that it executes that element. The specific order of execution is:

  • The Workflow engine runs Start before everything else
  • The Workflow engine runs Enter on entering a step.
  • The Workflow engine runs Exit upon leaving a step. It runs Exit before the branch leading to the next step. Thus, the actual execution logic from Step A to Step B is to Exit A, then do the Branch, then Enter B.
  • The Workflow engine runs GO, TRIGGER, TIMEOUT elements as it encounters them upon following a branch.
  • The Workflow engine runs Finish after it runs everything else.

Within the Gosu block, you can access the currently-executing workflow instance as Workflow. If you need to use local variables, declare them with var as usual in Gosu. However, if you need a value that persists from one step to another, create it as an extension field on Workflow and set its value from scripting. You can also create subflows in the Gosu blocks.

The current bundle for workflow actions is the bundle that the application uses to load the Workflow entity instance. The expression Workflow.Bundle returns the workflow bundle.

See also