The Workflow Tables

See Also

Workflow-enabled tables have a designated column that drives the workflow process for the rows in that table. There are no restrictions on the name of this column. However, throughout this documentation, we refer to it generically as the State column. This column has a corresponding row in the modColumns table with a reference to its workflow table.

The solution schema makes only one State column and one workflow table available per user table. The Access Workflow Designer creates a default name for the workflow table based on the name of the associated user table followed by the suffix "Workflow." For example, the workflow table associated with the Customer table is named CustomerWorkflow.

A team solution includes workflow tables containing all the actions that implement the default workflow logic for that solution. The Access Workflow Designer can be used to customize the workflow definition. For more information, see Building a Workflow Process. In addition, you can query the workflow table associated with the user table to write a custom workflow user interface that is similar to the workflow action bar in the Issue Tracking solution.

The schema for workflow tables is predefined. The State and NextState columns in the workflow table are bound to the lookup table associated with the State column of the corresponding user table.

The following table is an example of the workflow table schema.

Column Data type Description
Id identity (int) A unique identifier for the workflow activity.
Caption nvarchar(128) Name of the action; this can be used as a button label on a form.
State int The state associated with the workflow action; for transition actions, it is the initial state of the transition.
NextState int For transition actions, it is the final state of the transition. For state-bound actions, it is set to Null.
Event varchar(20) The event type of the workflow action.
Condition nvarchar(256) A function used to verify a complex condition, such as checking the status of subprocesses or checking values of other columns in the row — for example,
Check if LoanAmount > $50
. The workflow operation succeeds or fails based on this return value. If no condition is required, the column is set to Null.

For OnTimeout events, the function can include a date-time expression. This column makes possible the time-based execution of the action using a generic date-time expression that applies to all items.

Action nvarchar(256) A procedure that is executed if the condition is satisfied. The function implements the events that should take place during this action. The function should return either success or an error code. If no action is required, the column is set to Null.
Script ntext The script code of the Condition and Action functions.
Offline bit 1 if this workflow action can be executed offline. Rows with this value set to 0 will be partially replicated but will not be executed offline. Therefore, the action is not available to the offline client and must be performed online.
Created datetime Date this action was created. Always set to the current date on an Insert action.

Note   Dates cannot be relied upon to be precise due to clock variations between computers.

CreatedBy nvarchar(64) The user who created this action. Always set to CURRENT_USER on an Insert action.
Modified datetime Date this action was last modified. Always set to the current date on an Insert or Update action.
ModifiedBy nvarchar(64) The last user who modified this action. Always set to CURRENT_USER on an Insert or Update action.
Properties ntext A text column that makes it possible for the implementation of a property bag for each row. It can be used as an evaluation context for workflow optimization.
UI_Properties ntext A text column that stores a property bag for the client user interface. Its primary role is to store lists of columns that can be modified for each user interface action associated with the workflow action and the description of each user interface action.
rowguid uniqueidentifier Unique identifier used for workflow.