Platform SDK: Exchange 2000 Server |
[This is preliminary documentation and subject to change.]
Contains the state-transition rules for a workflow process definition, stored as an ADO Recordset. This is the central part of a workflow application.
[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);
When you save the ProcessDefinition, it validates the ActionTable to prevent the use of a poorly formed table.
The Action Table recordset requires the following thirteen schema:
The workflow engine performs a number of consistency checks as it processes a transition. The following list summarizes the checks and the error type returned by the workflow engine.
Consistency Check | Error Message |
---|---|
The actiontable is empty: | CDOWF_EMPTY_ACTIONTABLE. |
A column is missing, the data type isn't 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 shouldn't be: | CDOWF_E_EMPTY_CURSTATE |
The NewState column has something in it and shouldn't have: | CDOWF_E_NONEMPTY_NEWSTATE |
The NewState column is empty and shouldn't be: | CDOWF_E_EMPTY_NEWSTATE |
A transition acl is used in an onexpiry event (OnExpiry doesn't really have a "current user", so transition acls don't 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 |
The following code uses Microsoft® ActiveX® Data Objects 2.5 to create a new recordset with the appropriate fields for an action table.
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.
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