Automating Changes and Actions

See Also

You can automate changes in state by scripting a state’s OnTimeout event to evaluate a condition, and when that condition is met, perform an action—such as a state change or e-mail notification.

For example, in your Issue Tracking solution, you might want the state for issues that are in the Activated state for more than two weeks to be updated to the Escalated state automatically.

The SQL Server Agent monitors the OnTimeout event. The agent runs stored procedures on the server to execute the time-out events based on a predefined schedule. You can set up the agent to run hourly, daily, or weekly—based on the requirements of your team solution. Because the OnTimeout event relies on stored procedures on the server, these actions are not executed while a solution is offline.

To specify a time-out action

  1. In the Workflow Process pane, select the Design tab.

  2. In the workflow diagram, right-click the state, and select Add Action.

  3. In the Add Action dialog box, select Timeout.

  4. In the Action name field, enter a name, and click OK.

  5. If you want to add script to the action, double-click the action in the Actions list.

  6. In the Shared Script tab, modify the validation function, or add script to the action procedure directly below it. By default, the validation script procedure returns True.

  7. Click Verify Script to test the syntax of your script.

  8. Click Save.