When to Use Which Event

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

To help you decide when to use one of the several types of events available in a workflow process, the events are divided into four categories:

  • Row events facilitate changes to the rows storing information about an item. These events are used to trigger code and to designate permissible user interaction, such as creating a new record and deleting a record.
  • State entry or exit events occur immediately on entering or on leaving a state.
  • Transition events occur when moving from one state to another or from a state back to the same state.
  • Expiry events automate changes based on the time-out conditions you specify.

You can use the following table to determine which of the events to use:

To execute script for this action Use this event
A row is inserted into the database OnCreate
A row is deleted from the database OnDelete
A row is updated in the database OnChange
A state is entered OnEnter
A state is exited OnExit
The record moves between states OnChange
Specifying a condition for an automatic state change OnExpire

See Also

Scripting Workflow Events for SQL Server | Scripting Events in the Workflow Designer for SQL Server | Data Manipulation Using Workflow Script | Script Procedure Names | Control of Row Changes Based on State | OnEnter and OnExit Events | OnExpire Events | Adding Transition Events | Automating Changes and Events