Share via


ActionTable Property

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.

This contains the state-transition rules for a workflow process definition, stored as a Microsoft® ActiveX® Data Objects (ADO) recordset. This is the central part of a workflow application. Syntax is different for Microsoft® Visual Basic®, Microsoft® C++®, and IDL.

[Visual Basic,VBScript]
Public Property ActionTable as ADODB.Recordset
[C++]
HRESULT get_ActionTable(_Recordset** ppVal);
HRESULT put_ActionTable(_Recordset* pVal);
[IDL]
HRESULT [propget] ActionTable([out,retval] _Redordset** ppVal);
HRESULT [propput] ActionTable([in] _Redordset* pVal);

Remarks

The applications can use ADO, OLEDB, or WebDAV to update the ActionTable property directly. The ActionTable is persisted in Extensible Markup Language (XML) format. The workflow engine cannot read the ActionTable if it is not in this format.

When you save the ProcessDefinition, it validates the ActionTable to prevent the use of a poorly formed table. For information about the ProcessDefinition, see the Platform SDK: Exchange 2000 Server documentation in Microsoft® Developer Network (MSDN®) at http://msdn.microsoft.com.

The Action Table Recordset requires the following schema:

Recordset Description
ID String, some identifier for this row (optional).
Caption String, a display name for this step (optional).
State String, the current state of the ProcessInstance.
NewState String, the new state of the ProcessInstance, upon successful completion of this step.
EventType String, the type of event this step represents. CDOWFEventType enum lists possible values.
Condition String, a script expression, common script call, or COM object ProgID, which has a Boolean result. If you write the ProcessDefinition without the help of the ProcessDefinition object, the workflow engine will evaluate empty conditions as False. If you use the ProcessDefinition object, it will validate the action table and require a condition. An empty condition causes an error. If the workflow engine does not find a row in the ActionTable with a matching CdoWfEventType and a 'TRUE' condition, it returns a failure code CDOWF_NO_CONDS_MATCHED.
EvaluationOrder String, the position of a row in the order in which conditions will be evaluated given multiple matching rows in a call to advance. If this column of the action table contains no values, then no order is guaranteed. Action tables might have a mixture of blank and numeric entries, but only if they are not mixed for a given current state and event type.
Action String, a script expression, common script call, or COM object ProgID that executes if action table row matches the process instance and condition is True.
ExpiryInterval String, the duration (in minutes) that the item should remain in the new state before triggering an OnExpiry event. This is used only with the OnEnter event type.
RowACL String, required field reserved for future use. It must be empty.
TransitionACL String, you can define an ACL for the transition here that will override the default ACL which is the folder role. Valid roles include "Role1", "Role2", ... , "Role16".
DesignToolFields String, reserved for use by design tools, such as the Workflow Designer for Exchange (optional).
CompensatingAction String, a script expression, common script call, or COM object ProgID to run if the workflow transaction gets aborted.
Flags String, bitwise OR of cdowfTransitionFlags that indicate which columns in the action table will contain COM objects and which will contain script. Use zero (0x00) if this row contains only script conditions and events.

The workflow engine performs a number of consistency checks as it processes a transition. The following list summarizes the checks and the error types returned by the workflow engine:

Consistency Check Error Message
The ActionTable is empty: CDOWF_EMPTY_ACTIONTABLE
A column is missing, the data type is not a string, or the workflow engine has any other trouble reading a row: CDOWF_E_BAD_ACTIONTABLE
The event type is empty: CDOWF_E_EMPTY_EVENTTYPE
The event type is not valid: CDOWF_E_INVALID_EVENTTYPE
The State column has something in it and should not have (for OnCreate and OnEnter): CDOWF_E_NONEMPTY_CURSTATE
The State column is empty and should not be: CDOWF_E_EMPTY_CURSTATE
The NewState column has something in it and should not have: CDOWF_E_NONEMPTY_NEWSTATE
The NewState column is empty and should not be: CDOWF_E_EMPTY_NEWSTATE
A transition ACL is used in an onexpiry event (OnExpiry does not have a "current user", so transition ACLs do not make sense in this case): CDOWF_E_TRANSITIONACL_NO_USE_ONEXPIRY
TransitionFlags is empty or not valid: CDOWF_E_ROW_INVALID_FLAGS
EvaluationOrder has a duplicate order entry, the entry is not a number, or the sequence is not logical. CDOWF_E_DUPLICATE_ORDER

CDOWF_E_ROW_DUPLICATE_ORDER

CDOWF_E_ROW_INVALID_SEQUENCENUMBER

CDOWF_E_ROW_INVALID_SEQUENCING

CDOWF_INVALID_EVALUATION_ORDER

Example

The following code uses ADO 2.5 to create a new recordset with the appropriate fields for an action table:

[Visual Basic]

   Dim Rs As ADODB.Recordset
   Set Rs = New ADODB.Recordset

   With Rs.Fields
    .Append "ID", adBSTR
    .Append "Caption", adBSTR
    .Append "State", adBSTR
    .Append "NewState", adBSTR
    .Append "EventType", adBSTR
    .Append "Condition", adBSTR
    .Append "EvaluationOrder", adBSTR
    .Append "Action", adBSTR
    .Append "ExpiryInterval", adBSTR
    .Append "RowACL", adBSTR
    .Append "TransitionACL", adBSTR
    .Append "DesignToolFields", adBSTR
    .Append "CompensatingAction", adBSTR
    .Append "Flags", adBSTR
   End With

   Dim varColumnNames As Variant

   varColumnNames = Array(Rs.Fields.Item(0).Name, _
                         Rs.Fields.Item(1).Name, _
                         Rs.Fields.Item(2).Name, _
                         Rs.Fields.Item(3).Name, _
                         Rs.Fields.Item(4).Name, _
                         Rs.Fields.Item(5).Name, _
                         Rs.Fields.Item(6).Name, _
                         Rs.Fields.Item(7).Name, _
                         Rs.Fields.Item(8).Name, _
                         Rs.Fields.Item(9).Name, _
                         Rs.Fields.Item(10).Name, _
                         Rs.Fields.Item(11).Name, _
                         Rs.Fields.Item(12).Name, _
                         Rs.Fields.Item(13).Name)

The following code creates a new recordset object; creates the fields in the recordset; opens the recordset; adds new records to the recordset representing the rows in the action table; saves the recordset; and closes it.

[Visual Basic]

   Rs.Open
   If Err.Number <> 0 Then
      Debug.Print "Failed to open ActionTable Recordset" & Err.Description
   End If

   With Rs
    .AddNew varColumnNames, Array("1", "OnCreate", "", "Submitted", "OnCreate", "true", "", "sendmail(""new ProcessInstance"")", "", "", "", "", "", "0")
    .AddNew varColumnNames, Array("2", "OnEnter", "", "Submitted", "OnEnter", "true", "", "sendmail(""entered submitted state"")", "", "", "", "", "", "0")
    .AddNew varColumnNames, Array("3", "OnExpiry", "Submitted", "Submitted", "OnExpiry", "true", "", "sendmail(""submitted state expired"")", "", "", "", "", "", "0")
    .AddNew varColumnNames, Array("4", "OnDelete", "Submitted", "", "OnDelete", "true", "", "sendmail(""deleted ProcessInstance"")", "", "", "", "", "", "0")
   End With

See Also

Exchange Workflow Reference | Event Types | OnCreate Event | OnChange Event | OnDelete Event | OnEnter Event | OnExit Event | OnExpiry Event | OnReceive Event