Watch this: Design a document review workflow solution

March 21, 2008

Stephen Howard

Learn how to design a document review workflow and a custom Workflow Dashboard that shows you at a glance the status of all workflow tasks related to a specific document.

This series of videos presents an end-to-end scenario, starting with the necessary site components and ending with saving the solution as a site template so that you can reuse it. Along the way, see how to design several secondary workflows and learn how to use a wide range of workflow lookups.

You can also download the Visio diagram and site template.

Part 1: Get an overview of the prerequisite site components

Video preview Watch this Demo button

Get an overview of the two-tier document review process that this solution addresses. Then tour the key components of the site and see the custom lists and columns that support this workflow solution. And learn how to hide a column from the new item form, edit item form, and the Document Information Panel so that the column is reserved for use only by a workflow.

Part 2: Design the initiation form and first steps

Video preview Watch this Demo button

Design the initiation form and use the priority entered on the form to calculate the due date for the review tasks. Then learn how to make the due date calculated by the primary workflow available to a secondary workflow running on the Tasks list.

Part 3: Send a message to the document owner

Video preview Watch this Demo button

Learn some tips for creating HTML in Design view for use in workflow messages. Then send a message to the document owner that contains important information about the workflow, including the due date for the initial review and who the initial reviewers are.

Sample HTML: Notify the document owner that the workflow has started

You can copy and paste this HTML directly into the Define E-mail Message dialog box. Then replace the lookup placeholders — including the brackets — with the actual workflow lookups. This HTML contains no whitespace and uses only inline styles for formatting.

<table  dir="ltr" cellspacing="0"><tr ><td >The Review workflow has started on <strong>[**********LOOKUP Name**********]</strong>.</td></tr><tr><td>&nbsp;</td></tr><tr ><td >Dates</td></tr><tr><td ><p ><strong >[**********LOOKUP Document Owner**********]</strong> has requested <strong >[**********LOOKUP Priority**********]</strong>.</p><p >The initial reviewers must complete their review by <strong >[**********LOOKUP Initial Review Due Date**********]</strong>.</p></td></tr><tr ><td >Reviewers</td></tr><tr><td ><p >The initial reviewers are:</p><ul ><li ><strong >[**********LOOKUP Reviewer 1**********]</strong></li><li ><strong >[**********LOOKUP Reviewer 2**********]</strong></li><li ><strong >[**********LOOKUP Reviewer 3**********]</strong></li></ul><p >The backup reviewer is:</p><ul ><li ><strong >[**********LOOKUP Backup Reviewer**********]</strong></li></ul></td></tr><tr ><td >Links</td></tr><tr><td ><ul ><li ><a  href="[**********LOOKUP%20Dashboard%20URL**********]">Workflow Dashboard</a></li><li ><a  href="[**********LOOKUP%20Document%20DispForm**********]">View the document properties</a></li><li ><a  href="[**********LOOKUP%20Encoded%20Absolute%20URL**********]">Open the document</a></li></ul></td></tr></table>

Part 4: Assign tasks to the initial reviewers

Video preview Watch this Demo button

Use the Collect Data from a User action to assign separate tasks in parallel to the initial reviewers.



Part 5: Design a secondary workflow for the initial review tasks

Video preview Watch this Demo button

Design a secondary workflow that manages the tasks of the initial reviewers while the primary workflow is paused. Also learn about the relationship between the Workflow Item ID in the Tasks list and the ID in the original list or library.

Part 6: Design a secondary workflow for the initial review tasks (continued)

Video preview Watch this Demo button

The secondary workflow sends a reminder message to the initial reviewer if the task is not completed by the reminder date. Also learn how to build a dynamic hyperlink to the custom task form to include in the reminder message.

Sample HTML: Send a reminder to the initial reviewer

You can copy and paste this HTML directly into the Define E-mail Message dialog box. Then replace the lookup placeholders — including the brackets — with the actual workflow lookups. This HTML contains no whitespace and uses only inline styles for formatting.

<table  dir="ltr" cellspacing="0"><tr ><td ><strong >REMINDER:</strong> You have a workflow task to review <strong>[**********LOOKUP Document Name**********]</strong>.</td></tr><tr><td>&nbsp;</td></tr><tr ><td >Dates</td></tr><tr><td ><p >You must complete your review by <strong >[**********LOOKUP Task Due Date**********]</strong>.</p><p >If the task is not completed by the due date, it will be reassigned to the backup reviewer.</p></td></tr><tr ><td >Links</td></tr><tr><td ><ul ><li ><a  href="[**********LOOKUP Custom Task Form**********]">Edit this task</a></li><li ><a  href="[**********LOOKUP Dashboard URL**********]">Workflow Dashboard</a></li><li ><a  href="[**********LOOKUP Document DispForm**********]">View the document properties</a></li><li ><a  href="[**********LOOKUP Document Encoded Absolute URL**********]">Open the document</a></li></ul></td></tr></table>

Part 7: Design a secondary workflow for the initial review tasks (continued)

Video preview Watch this Demo button

If the task is not completed by the due date, the secondary workflow reassigns the task from the initial reviewer to the backup reviewer. Learn how to do a complex lookup from one list to a third list via an intermediate second list.

Sample HTML: Send a notification that the initial review task was reassigned

You can copy and paste this HTML directly into the Define E-mail Message dialog box. Then replace the lookup placeholders — including the brackets — with the actual workflow lookups. This HTML contains no whitespace and uses only inline styles for formatting.

<table  dir="ltr" cellspacing="0"><tr ><td ><strong >TASK REASSIGNED:</strong> A reviewer has changed for <strong>[**********LOOKUP Document Name**********]</strong>.</td></tr><tr><td>&nbsp;</td></tr><tr ><td >Dates</td></tr><tr><td ><p >An initial review task was not completed by <strong >[**********LOOKUP Task Due Date**********]</strong>.</p></td></tr><tr ><td >Reviewers</td></tr><tr><td ><p >This task was originally assigned to:</p><ul ><li ><strong >[**********LOOKUP Initial Reviewer**********]</strong></li></ul><p >The task is now assigned to:</p><ul ><li ><strong >[**********LOOKUP Backup Reviewer**********]</strong></li></ul></td></tr><tr ><td >Links</td></tr><tr><td ><ul ><li ><a  href="[**********LOOKUP%20Dashboard%20URL**********]">Workflow Dashboard</a></li><li ><a  href="[**********LOOKUP%20Document%20DispForm**********]">View the document properties</a></li><li ><a  href="[**********LOOKUP%20Document%20Encoded%20Absolute%20URL**********]">Open the document</a></li></ul></td></tr></table>

Part 8: Determine whether a majority of initial reviewers approved the document

Video preview Watch this Demo button

The Review workflow resumes and determines whether a majority of the initial reviewers consider the document ready for final review. Learn how to use workflow lookups to retrieve the responses of the reviewers from items in the Tasks list.

Sample HTML: Send a notification that the document did not pass the initial review

You can copy and paste this HTML directly into the Define E-mail Message dialog box. Then replace the lookup placeholders — including the brackets — with the actual workflow lookups. This HTML contains no whitespace and uses only inline styles for formatting.

<table  dir="ltr" cellspacing="0"><tr ><td >The Review workflow has completed on <strong>[**********LOOKUP Name**********]</strong>.</td></tr><tr><td>&nbsp;</td></tr><tr ><td >Outcome</td></tr><tr><td ><p >The initial reviewers have determined that the document is <strong >not ready for final review</strong>.</p><p >To view the responses of the initial reviewers, go to the <a  href="[**********LOOKUP%20Dashboard%20URL**********]">Workflow Dashboard</a>.</p></td></tr><tr ><td >Links</td></tr><tr><td ><ul ><li ><a  href="[**********LOOKUP%20Dashboard%20URL**********]">Workflow Dashboard</a></li><li ><a  href="[**********LOOKUP%20Document%20DispForm**********]">View the document properties</a></li><li ><a  href="[**********LOOKUP%20Encoded%20Absolute%20URL**********]">Open the document</a></li></ul></td></tr></table>

Part 9: Assign a task to the final reviewer

Video preview Watch this Demo button

The Review workflow calculates the final review due date, and then determines whether the document is checked in before checking out the document and setting the Final Review Due Date field. Then the workflow assigns a task to the final reviewer.

Sample HTML: Send a request to check in the document

You can copy and paste this HTML directly into the Define E-mail Message dialog box. Then replace the lookup placeholders — including the brackets — with the actual workflow lookups. This HTML contains no whitespace and uses only inline styles for formatting.

<table  dir="ltr" cellspacing="0"><tr ><td ><p >The Review workflow is <strong >blocked</strong> because you have this document checked out:</p><p ><strong>[**********LOOKUP Name**********]</strong></p></td></tr><tr><td>&nbsp;</td></tr><tr><td ><p >Please click one of the following links and then check in the document.</p><p >When you check in the document, the Review workflow will <strong>automatically</strong> resume.</p></td></tr><tr ><td >Links</td></tr><tr><td ><ul ><li ><a  href="[**********LOOKUP%20Document%20DispForm**********]">View the document properties</a></li><li ><a  href="[**********LOOKUP%20Encoded%20Absolute%20URL**********]">Open the document</a></li></ul></td></tr></table>

Sample HTML: Send a notification that the final review has started

You can copy and paste this HTML directly into the Define E-mail Message dialog box. Then replace the lookup placeholders — including the brackets — with the actual workflow lookups. This HTML contains no whitespace and uses only inline styles for formatting.

<table  dir="ltr" cellspacing="0"><tr ><td >The initial review of <strong>[**********LOOKUP Name**********]</strong> is completed.</td></tr><tr><td>&nbsp;</td></tr><tr ><td >Outcome</td></tr><tr><td ><p >The initial reviewers have determined that the document is <strong >ready for final review</strong>.</p><p >To view the responses of the initial reviewers, go to the <a  href="[**********LOOKUP%20Dashboard%20URL**********]">Workflow Dashboard</a>.</p></td></tr><tr ><td >Dates</td></tr><tr><td ><p ><strong >[**********LOOKUP Document Owner**********]</strong> has requested <strong >[**********LOOKUP Priority**********]</strong>.</p><p >The final reviewer must complete the review by <strong >[**********LOOKUP Final Review Due Date**********]</strong>.</p></td></tr><tr ><td >Reviewers</td></tr><tr><td ><p >The final reviewer is:</p><ul ><li ><strong >[**********LOOKUP Final Reviewer**********]</strong></li></ul></td></tr><tr ><td >Links</td></tr><tr><td ><ul ><li ><a  href="[**********LOOKUP%20Dashboard%20URL**********]">Workflow Dashboard</a></li><li ><a  href="[**********LOOKUP%20Document%20DispForm**********]">View the document properties</a></li><li ><a  href="[**********LOOKUP%20Encoded%20Absolute%20URL**********]">Open the document</a></li></ul></td></tr></table>

Part 10: Design a secondary workflow for the final review task

Video preview Watch this Demo button

Design a secondary workflow that sends a series of reminders to the final reviewer while the primary workflow is paused.

Sample HTML: Send a reminder to the final reviewer

You can copy and paste this HTML directly into the Define E-mail Message dialog box. Then replace the lookup placeholders — including the brackets — with the actual workflow lookups. This HTML contains no whitespace and uses only inline styles for formatting.

<table  dir="ltr" cellspacing="0"><tr ><td ><strong >REMINDER:</strong> You have a workflow task to review <strong>[**********LOOKUP Document Name**********]</strong>.</td></tr><tr><td>&nbsp;</td></tr><tr ><td >Dates</td></tr><tr><td ><p >The due date for the final review is <strong >[**********LOOKUP Final Review Due Date**********]</strong>.</p></td></tr><tr ><td >Links</td></tr><tr><td ><ul ><li ><a  href="[**********LOOKUP%20Custom%20Task%20Form**********]">Edit this task</a></li><li ><a  href="[**********LOOKUP%20Dashboard%20URL**********]">Workflow Dashboard</a></li><li ><a  href="[**********LOOKUP%20Document%20DispForm**********]">View the document properties</a></li><li ><a  href="[**********LOOKUP%20Document%20Encoded%20Absolute%20URL**********]">Open the document</a></li></ul></td></tr></table>

Part 11: Determine whether the final reviewer approved the document

Video preview Watch this Demo button

Do a workflow lookup to retrieve the response of the final reviewer from the Tasks list. If the final reviewer approved the document, the Review workflow sets the Document Status field of the document to Reviewed.

Sample HTML: Send a notification that the document did not pass the final review

You can copy and paste this HTML directly into the Define E-mail Message dialog box. Then replace the lookup placeholders — including the brackets — with the actual workflow lookups. This HTML contains no whitespace and uses only inline styles for formatting.

<table  dir="ltr" cellspacing="0"><tr ><td >The Review workflow has completed on <strong>[**********LOOKUP Name**********]</strong>.</td></tr><tr><td>&nbsp;</td></tr><tr ><td >Outcome</td></tr><tr><td ><p >The final reviewer has determined that the document is <strong >not ready for scheduling</strong>.</p><p >To view the comments of the initial and final reviewers, go to the <a  href="../[**********LOOKUP%20Dashboard%20URL**********]">Workflow Dashboard</a>.</p></td></tr><tr ><td >Links</td></tr><tr><td ><ul ><li ><a  href="../[**********LOOKUP%20Dashboard%20URL**********]">Workflow Dashboard</a></li><li ><a  href="../[**********LOOKUP%20Document%20DispForm**********]">View the document properties</a></li><li ><a  href="../[**********LOOKUP%20Encoded%20Absolute%20URL**********]">Open the document</a></li></ul></td></tr></table>

Sample HTML: Send a request to check in the document

You can copy and paste this HTML directly into the Define E-mail Message dialog box. Then replace the lookup placeholders — including the brackets — with the actual workflow lookups. This HTML contains no whitespace and uses only inline styles for formatting.

<table  dir="ltr" cellspacing="0"><tr ><td ><p >The Review workflow is <strong >blocked</strong> because you have this document checked out:</p><p ><strong>[**********LOOKUP Name**********]</strong></p></td></tr><tr><td>&nbsp;</td></tr><tr><td ><p >Please click one of the following links and then check in the document.</p><p >When you check in the document, the Review workflow will <strong>automatically</strong> resume.</p></td></tr><tr ><td >Links</td></tr><tr><td ><ul ><li ><a  href="[**********LOOKUP%20Document%20DispForm**********]">View the document properties</a></li><li ><a  href="[**********LOOKUP%20Encoded%20Absolute%20URL**********]">Open the document</a></li></ul></td></tr></table>

Sample HTML: Send a notification that the document passed the final review

You can copy and paste this HTML directly into the Define E-mail Message dialog box. Then replace the lookup placeholders — including the brackets — with the actual workflow lookups. This HTML contains no whitespace and uses only inline styles for formatting.

<table  dir="ltr" cellspacing="0"><tr ><td >The Review workflow has completed on <strong>[**********LOOKUP Name**********]</strong>.</td></tr><tr><td>&nbsp;</td></tr><tr ><td >Outcome</td></tr><tr><td ><p >The final reviewer has determined that the document is <strong >ready for scheduling</strong>.</p><p >To view the comments of the initial and final reviewers, go to the <a  href="../[**********LOOKUP%20Dashboard%20URL**********]">Workflow Dashboard</a>.</p></td></tr><tr ><td >Links</td></tr><tr><td ><ul ><li ><a  href="../[**********LOOKUP%20Dashboard%20URL**********]">Workflow Dashboard</a></li><li ><a  href="../[**********LOOKUP%20Document%20DispForm**********]">View the document properties</a></li><li ><a  href="../[**********LOOKUP%20Encoded%20Absolute%20URL**********]">Open the document</a></li></ul></td></tr></table>

Part 12: Design the Workflow Dashboard

Video preview Watch this Demo button

Design a short, one-step secondary workflow that sets the completion date for every workflow task. Next, copy and modify the Tasks data source so that you can add Workflow Item Id and Workflow Instance ID to the data source query. Then create the Workflow Dashboard page and insert a Data View that contains the fields you want.

Part 13: Design the Workflow Dashboard (continued)

Video preview Watch this Demo button

Filter the Data View by Workflow Item Id by using the below code snippet, and then group the Data View by Workflow Instance ID. Then create the conditional formatting rules and use the Apply Styles task pane to identify and apply styles from core.css.

Code snippet: Filter a Data View by Workflow Item Id

To filter a Data View by Workflow Item Id, you first need to copy and paste a code snippet into the Data View. In Code view, press CTRL+F and search for the following tag./ViewFields&gt; Immediately after that tag, paste the following markup.

&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;WorkflowItemId&quot;/&gt;&lt;Value Type=&quot;Integer&quot;&gt;&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;

Part 14: Share or reuse your workflow solution

Video preview Watch this Demo button

Reuse your workflow solution by saving it as a site template. A site template is stored in the Site Template Gallery in the top-level site in the site collection, where it is available to create new sites from in any site in the site collection. This file can also be downloaded from the Site Template Gallery and migrated to another site collection or to a different server.

 
 
Applies to:
SharePoint Designer 2007