The Conceptual Stage
The Basics
Conceptually speaking, any given stage has the following phases:
- Pre-Stage Actions
Anything that takes place before a stage actually begins. E.g., check that certain pre-conditions are met before proceeding.
- Begin Stage Actions
Whatever should happen at the beginning of the stage. E.g., print or log some information for the user, capture timing information, etc.
- Stage Body
The actual work of the stage itself, which is entirely dependent on the script you’re writing.
- End Stage Actions
Whatever should happen at the end of the stage. E.g., print or log more information for the user, capture timing information, etc.
- Post-Stage Actions
Anything that takes place after a stage has finished. E.g., check that certain post-conditions have been satisfied.
Depending on your script, some of these phases may be no-ops (e.g., pre-/post-stage actions), but conceptually they’re all there.
Skipping Stages
If we want to get a bit fancier, we can include another phase for Skip Stage Actions, which are whatever we want to do if we dynamically decide to skip a stage. Adding this feature changes the execution flow to the following:
Retrying Stages
If we want to get even fancier, we can allow for a stage to be automatically retried. Such flexibility is beneficial, because often you’re able to programmatically determine if something has gone wrong during a stage. In such circumstances, rather than requiring the user to see the problem, decide what to do, and then act, you can design the stage to automatically retry itself. In that case, we add a Retry Stage Actions phase, and the execution flow becomes the following:
For details on how all the flexibility above is made available to the user, see Stage Implementation Details.