SBM AppScript Reference → Introduction to SBM AppScript → SBM AppScript Contexts → 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:
Pre-Transition – Execute as the Transition form is generated and can display special messages at the top of the form or pre-populate fields with data.
Post-Transition – Execute after the form is submitted and can validate form field values or perform other post-processing.
Post-State – When a transition causes an item to change state, the old state's Post-State script executes immediately after the Post-Transition script (if any). In other words, Post-State scripts run as an item leaves a state.
Pre-State – When a transition causes an item to change state, the new state's Pre-State script, if any, is executed. In other words, Pre-State scripts run as an item enters a state.
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.
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.
Copyright © 2007–2018 Serena Software, Inc., a Micro Focus company. All rights reserved.