Platform SDK: Exchange 2000 Server

TrackingTable Property

[This is preliminary documentation and subject to change.]

Returns a pointer to the recordset object containing message data related to the process instance that initiated the state transition. (Read-only)

[Visual Basic,VBScript]
Property TrackingTable As Recordset
[C++]
HRESULT TrackingTable(_Recordset** varTrackingTable);
[IDL]
HRESULT TrackingTable([out, retval] _Recordset** varTrackingTable);

Remarks

(Read-only)

The workflow engine uses the TrackingTable to store information regarding emails correlated with a ProcessInstance. If the engine matches a row in the ActionTable with an OnReceive event, it makes an entry in the TrackingTable for the ReceivedMessage.

The tracking table provides you with ten fields that you can use to store additional properties you may wish to track. These are the custom0 through custom9 fields.

Records in the TrackingTable have the following fields:

Field Name Type Maximum Size May be NULL
email WCHAR 512 characters No
trackingid WCHAR 512 characters Yes
date WCHAR 512 characters No
state WCHAR 512 characters No
flags WCHAR 512 characters No
response WCHAR 512 characters Yes
custom0 - custom9 WCHAR 512 characters Yes

TrackingTable Field Semantics
email
This contains the address in the 'To' field of outgoing forms or messages.
trackingid
This is a guid created by the workflow engine when you use SendWorkflowMessage(). The engine uses this guid to correlate all subsequent messages associated with the ProcessInstance.
date
For outgoing messages, this is the 'sent' time. For incoming messages, this is the 'received' time.
state
The workflow engine puts the state of the ProcessInstance here when you use SendWorkflowMessage(). It puts the ProcessInstance state in this field for all correlated responses as well.
flags
This can be 'cdowfStrict', 'cdowfAdd', or 'cdowfNoTracking'. When you use SendWorkflowMessage(cdowfStrict), the engine puts 'cdowfStrict' in this field.
response
The workflow engine automatically copies the value of the form field "http://schemas.microsoft.com/cdo/workflow/response" into this column without you having to write any code.
custom0 - custom9
These are ten fields that you can use to store data from your form. You need to write the script code to copy the data to the TrackingTable.

Example

Here is an example using the TrackingTable property in a script function. The function checks all the records in the TrackingTable for a match between the response sender and the email field of the table. If it finds an address match, it checks to see if the value in the table's state field matches the state in the current ActionTable row from which this script was called. If both match, it adds a value to a custom property field in the TrackingTable.

[VB Script]
Sub AddProp()

WorkflowSession.TrackingTable.MoveFirst

For i = 0 to WorkflowSession.TrackingTable.RecordCount-1 Step 1

   if WorkflowSession.Sender = WorkflowSession.TrackingTable.Fields("email").value then
      WorkflowSession.AddAuditEntry "email address matched"

      if "A"=WorkflowSession.TrackingTable.Fields("state").value then 
         'the state value here is hard coded you will have to 
         'change this for your own action table
         WorkflowSession.AddAuditEntry "state matched"

         WorkflowSession.TrackingTable.Fields.Item("custom0").Value= WorkflowSession.ReceivedMessage.Fields("Amount").value

         WorkflowSession.AddAuditEntry "added the value to the customfield"
         WorkflowSession.TrackingTable.Update
      End if
   End if
   WorkflowSession.TrackingTable.MoveNext
Next
WorkflowSession.DeleteReceivedMessage

End Sub

See Also

IWorkflowSession