Adding a Workflow Process to your Solution

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.

You can add workflow to a table by creating a set of state values or by using an existing column in your table. There are certain rules about the type of existing columns that you can use to create a workflow process. For more information, see "Workflow Schema Guidelines" in Team Solution Development Guidelines.

To review design and workflow process planning considerations, see Designing your Workflow Process and The Workflow Engine Model.

Before adding workflow, be sure to register the database as a solution database using the Access Workflow Designer. To review the prerequisites for adding workflow to your database, see Building a Workflow Process.

To add workflow to your team solution

  1. Open your team solution in the Access Workflow Designer. For details, see Accessing Access Workflow Designer Tools.

  2. Right-click the Workflow Processes node, and select New Workflow Process.

    **Note   **Only one developer can change the workflow at a time. If another developer is modifying a workflow process, you get a message informing you to wait until the other developer has finished.

  3. In the Workflow Process wizard, click Next.

  4. Select the table for which you want to specify a workflow.

    Note   If no tables are listed, you must add table hierarchy. For more information, see Identifying Main User Tables.

  5. Create or choose a workflow column to hold the state information for each item in your table, and then click Next.

    The workflow column can be either an existing column in your table that contains status information you want to use to control the workflow (for details, see "Workflow Schema Guidelines" in Team Solution Development Guidelines) or an entirely new column you create with your own status or state keywords.

  6. In the Add new lookup table keyword box, enter a word for each state you want to track in the process, and then click New to add it to the Lookup keywords box.

  7. Click Add to move the keywords into the Workflow states box.

  8. To specify the order of the states within the workflow process, highlight a state and click the Move Up and Move Down buttons to move it up or down in the list.

    The order of the states is significant, because, by default, the wizard generates workflow actions that prevent an item from skipping states. If you want to specify actions that make it possible for skipping states or alternative processing depending on other conditions, you must customize the workflow diagram. For more information, see Using the Workflow Diagram.

  9. Click Next, verify the information, and then click Finish.

    The new workflow process is displayed in the Workflow Process pane. You can add actions and script event handlers to the workflow to fulfill the requirements of your team solution. Your workflow actions also have basic validation events.

Using the Workflow Diagram

The three sections in the Workflow Process pane show the workflow schema graphically (left), the available actions for the various objects in the diagram (right), and the script editor (lower).

These panes can be resized by clicking on the dividing lines. Right-click in the workflow diagram to view your zoom and layout options.

In the workflow diagram, notice that in addition to the workflow states you created, there are start and end blocks. There are also connections between the states representing the state transitions, for example Active_Resolved. You can rename these to something more meaningful to your solution by selecting a transition and editing the Action Name box on lower portion of the workflow diagram.

If you expand the view of the Issues table, you will see that an additional table has been added to your database schema — for example, IssuesStateLookup. If you switch back to Access and press F5 to refresh the database window, you'll see that many objects have been added to your Access Project. You can also view these objects in the SQL Server Enterprise Manager if you have SQL Server installed.

You can modify your workflow design using this workflow diagram by adding additional transitions between states and additional actions. Right-clicking existing states creates both actions and transitions.

When you add a transition, you create a permissible change from one state to another. In the example workflow process earlier, a record cannot go directly from Active to Closed. That transition would be rejected. However, if you right-clicked Active and added this transition, then the database would permit this state change.

When you add an action, you are creating a valid activity that can be performed by the database user. For example, by default, only the last state has an action of Delete, and only the first state has an action of New. This means, by default, you cannot delete a record that is in an Active state, and you cannot create a new record with a state other than Active.

Adding actions also gives you opportunities to use script. Notice when you click an action in the upper-right corner of the workflow diagram that the associated events are shown in the script editor in the lower section of the window. For example, select the Active state, and click the New action. In the script editor portion of the pane, the ValidateOnCreate() and Sub OnCreate events are shown. The ValidateOncreate function was created by the Workflow Process wizard. For information on workflow scripting, see Scripting Workflow Actions.