Creating a ProcessDefinition Object
Creating a ProcessDefinition Object
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.
The ProcessDefinition object encapsulates your business logic and defines how the workflow engine will advance a workflow item. The ProcessDefinition object also determines which privileges your scripts have and which audit trail provider the workflow engine uses. For more information about script privileges and audit trails, see Privilege Checking and Using an Audit Trail.
The following code demonstrates how to create a new ProcessDefinition object and an ActiveX Data Objects (ADO) Connection. The code binds to the target Exchange store folder with a Connection object. With the open connection, it sets the desired properties on the ProcessDefinition object. It then uses the Recordset object that was built at run time and sets the ActionTable Property on the ProcessDefinition object. For more information about creating action tables, see Defining the ActionTable. Finally, the code saves the ProcessDefinition properties to the URLs and commits the transaction.
Visual Basic
Note The following example uses a file URL with the Exchange OLE DB (ExOLEDB) provider. The ExOLEDB provider also supports The HTTP: URL Scheme. Using The HTTP: URL Scheme allows both client and server applications to use a single URL scheme.
Dim iPD As New CDOWF.ProcessDefinition Dim conn As New ADODB.Connection sDomainURL = "file://./backofficestorage/" _ & Environ("USERDNSDOMAIN") & _ "/Public Folders/" sFolderURL = sDomainURL & sFolderName sProcDefURL = sFolderURL & "/" & sProcDef conn.Provider = "ExOleDb.DataSource" conn.Open sFolderURL conn.BeginTrans With iPD .ActionTable = Rs ' Rs is an open ADODB.Recordset built at run time. .AuditTrailProvider = "CdoWf.AuditTrailEventLog" .CommonScriptURL = sCommonScriptURL .Mode = cdowfPrivilegedMode .Fields("DAV:ishidden") = True End With iPD.DataSource.SaveTo sProcDefURL, _ conn, _ adModeReadWrite, _ adCreateNonCollection conn.CommitTrans ' Close connection. conn.Close Set conn = Nothing
Send us your feedback about the Microsoft Exchange Server 2003 SDK.
Build: June 2007 (2007.618.1)
© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.