Share via


Automating Changes and Events

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.

You can automate events by scripting an OnExpire event to evaluate a condition and, when that condition is met, perform an action — such as a transition or e-mail notification.

To add an OnExpire event

  1. In the workflow process diagram, select the transition that you want to function as an Expiry transition.
  2. Set the Type property of the transition to Expiry.
  3. Double-click the Expiry transition in the workflow process diagram. If, for example, the transition is named Expire1, the Code Editor will open with Sub Expire1_OnExpire/End Sub event procedure tags added for the OnExpire event.
  4. Select the name of the Expiry transition from the Object list at the top of the Code Editor window, and select OnExpireValidate from the Event list to add validation procedure tags to the script.
  5. Enter your code to validate the time-out conditions and the script you want to execute on time-out.
  6. Open the Workflow Manager for SQL Server.
  7. On the Tools menu, click WorkflowTimeout Job.
  8. Edit the timeout properties as desired. For details, refer to the Microsoft® SQL Server™ documentation.

See Also

When to Use Which Event | Script Procedure Names | Control of Row Changes Based on State | OnEnter and OnExit Events | OnExpire Events | Adding Transition Events