Share via


ActionTable Property

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.

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.

Applies To

IProcessDefinition Interface

Type Library

Microsoft CDO Workflow Objects for Microsoft Exchange

DLL Implemented In

CDOWF.DLL

Syntax

[Visual Basic]Property ActionTable As ADODB.Recordset

[C++]HRESULT get_ActionTable(Recordset** pVal);
HRESULT put
ActionTable(_RecordsetVal);

Parameters

  • pVal
    Returns the value of the ActionTable property as a reference to a _Recordset.
  • Val
    Sets the value of the ActionTable property to the value of the _Recordset.

Remarks

This property corresponds directly to the Exchange store property https://schemas.microsoft.com/cdo/workflow/actiontable. Applications can also use ADO, OLE DB, or WebDAV to update this property directly. The ActionTable is persisted in XML format. The workflow engine cannot read the ActionTable if it is not in this format.

When you save the process definition, it validates the ActionTable to prevent the use of a poorly formed table.

The Action Table Recordset requires the following fourteen schema:

  1. "ID", String, Some identifier for this row (optional).
  2. "Caption", String, A display name for this step (optional).
  3. "State", String, The current state of the ProcessInstance.
  4. "NewState", String, The new state of the ProcessInstance, upon successful completion of this step.
  5. "EventType", String, The type of event this step represents. CDOWFEventType enum lists possible values.
  6. "Condition", String, A script expression, common script call, or Component Object Model (COM) object programmatic identifier (PROGID) (see ICustomActivity Interface) whose result is Boolean. 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.
  7. "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 may have a mixture of blank and numeric entries, but only if they are not mixed for a given current state and event type.
  8. "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.
  9. "ExpiryInterval", String, The duration (in minutes) that the item should remain in the new state before triggering an OnExpiry event. This is only used with the OnEnter event type.
  10. "RowACL", String, Required field reserved for future use. It must be empty.
  11. "TransitionACL", String, You can define an access control list (ACL) for the transition here that will override the default ACL which is the folder role. Valid roles include "Role1", "Role2", ... , "Role16".
  12. "DesignToolFields", String, Reserved for use by design tools such as Workflow Designer for Exchange 2000 Server (optional).
  13. "CompensatingAction", String, A script expression, common script call, or COM object ProgID to run if the workflow transaction gets aborted.
  14. "Flags", String, Bitwise OR of CdoWfTransitionFlags Enum 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 actions.

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 shouldn't 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 really have a "current user", so transition access control lists (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

Examples

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

IProcessDefinition Interface

Defining the ActionTable

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.