Share via


Workflow Scripting Guidelines

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 add script to your workflow events to enhance the workflow process. When scripting, the following guidelines and restrictions should be considered:

  • By default, an error raised from a validation or event procedure causes the event's transaction to be rolled back. If you want to prevent this, trap the error using On Error Resume Next, and provide your own error handling.
  • Make sure your script has error handling for cases where user directory information is not available — for example, to handle gracefully cases where a user's e-mail address or manager is blank or Null. This could happen when the required information is not available in the master Microsoft® Windows NT® domain or Microsoft® Exchange directory.
  • You can link multiple workflow processes together by inserting, updating, or deleting rows in other workflow-enabled tables from your workflow script. This can be used to create parallel workflow processes.
  • The validation procedure for an Expiry (OnExpire) event should return True if the time has expired; otherwise, False.
  • Do not perform updates from within a validation procedure. This introduces unexpected side effects from the validation procedure, even when the validation returns False.
  • You cannot display messages directly to the user interface from workflow script (for example, by use of a message box), because the script runs on the server.
  • You can test and debug workflow by writing to the Logger object file.

See Also

Workflow Application Development Guidelines | Database Schema Design Guidelines | Data Access Page (User Interface) Guidelines | Testing and Debugging in the Workflow Designer for SQL Server