Transition-Related Contexts

In transition-related contexts, a script executes as a transition executes. For each context, a workflow setting determines which script, if any, executes. Pre-Transition and Post-Transition scripts can be associated with transitions at the workflow level at which the transition is created. Pre-State scripts and Post-State scripts can be associated with states at the workflow level at which the state is created.

The four transition-related contexts in order of execution are:

When a transition executes, it proceeds through the stages shown in the following diagram. After all associated scripts have executed successfully, the transition is complete and new field values are written to the database. Note that scripts only execute as configured by the workflow.

transition execution sequence
Note: When invalid values are provided by the user on a form, the script runs again when the user is prompted to provide valid values if a rule like If form is invalid, rerun this script is defined for a Pre-Transition script. If the rule is set to don't rerun, the script is not automatically run again. This applies to pre-transition Web services as well.

If you have configured a pre-trans Web service and a pre-transition script, the Web service runs before the script. Both action types can re-run or not re-run if the form has an error, and they will run in the same order if both are marked for rerun.

Note: For efficiency, the second "Auto" resolution is skipped if there are no scripts to run after the form is submitted (i.e., there is no corresponding Post-Transition, Post-State, or Pre-State script). When there are no such scripts, the two "Auto" resolution steps are redundant because they would execute back to back.