Platform SDK: Exchange 2000 Server

Writing Typical Workflow Applications

[This is preliminary documentation and subject to change.]

The workflow components installed with Exchange 2000 Server include an implementation of a runtime object method called Advance. We call this and all its supporting code the workflow engine. The engine and the workflow event sink take care of creating the runtime objects that it uses to implement your design and provide your script with the data it needs. The typical workflow application developer will use the WorkflowSession object primarily for running scripts that she has added with the Workflow Designer tool.

WorkflowSession

The workflow engine passes this intrinsic object to the script host environment. It includes a Fields collection object representing the ProcessInstance, or Web Store row, undergoing transition. Your scripts can modify this row to create desirable side-effects for a state transition. For instance, new contact information gets saved in a folder, so your script adds sales region ID and regional manager ID fields to the row and populates those fields.

Your script can pass errors back to the WorkflowSession object, and they will be logged by your audit logging tool. You can also use the audit logging support for sending informational messages to your audit logging tool.

The WorkflowSession object also provides a method for tracking notifications and responses correlated with a specific ProcessInstance in its TrackingTable property. This property returns an ADODB.Recordset for easy data manipulation.

AuditTrailEventLog, AuditTrailPropPI, and AuditTrailPropWF

The typical workflow application developer will access the audit trail functionality through the IWorkflowSession object by calling AddAuditEntry. You will not create these objects directly.

These are built-in audit trail providers that Exchange 2000 Server includes for your use. Advanced developers may write providers by implementing the IAuditTrail interfaceand may specify which provider to use at design-time using the ProgID in the ProcessDefinition AuditTrailProvider property.

SessionProps

The Properties property of the WorkflowSession object returns ISessionProps interface. This provides a property bag in which to cache your custom properties between script function calls during a single ProcessInstance transition.

WorkflowMessage

This object provides several useful e-mail features for workflow. They include the following:

WorkflowMessage is not cocreatable. You access this functionality through the WorkflowSession object. The WorkflowSession object provides the GetNewWorkflowMessage method for sending e-mail notifications. The IWorkflowMessage interface contains the IMessage interface and adds one unique method—SendWorkflowMessage.