which country user step here?

Tag Cloud

MOSS (47) SharePoint 2007 (37) SharePoint 2013 (31) SharePoint 2010 (23) MOSS admin (17) PowerShell (17) admin (17) developer (16) List (15) WSS (14) sql query (14) MOSS SP2 (13) end user (11) scripting (11) wss V3 (11) permission (10) sql (9) Moss issue (8) search (8) database (7) RBS (6) Service Pack (6) reportadmin (6) workflow (6) CU (5) Excel (5) Patch (5) client object model (5) Client Code (4) Command (4) Cumulative Updates (4) IIS (4) SharePoint 2019 (4) SharePoint designer (4) office 365 (4) stsadm (4) user porfile (4) ASP.NET (3) Content Database (3) Groove (3) Host Named Site Collections (HNSC) (3) SharePoint 2016 (3) Tutorial (3) alert (3) authentication (3) batch file (3) codeplex (3) domain (3) error (3) incomming email (3) issue (3) restore (3) upload (3) Caching (2) DocAve 6 (2) Folder (2) Index (2) Internet (2) My Site Cleanup Job (2) My Sites (2) News (2) People Picker (2) Share Document (2) SharePoint admin (2) View (2) Web Development with ASP.NET (2) add user (2) audit (2) coding (2) column (2) deploy solution (2) download (2) enumsites (2) exam (2) export (2) june CU (2) load balance (2) mySites (2) network (2) orphan site (2) performance (2) profile (2) project server (2) query (2) security (2) server admin (2) theme (2) timer job (2) training (2) web master (2) web.config (2) wsp (2) 70-346 (1) 70-630 (1) AAM (1) Anonymous (1) Approval (1) AvePoint (1) Cerificate (1) Consultants (1) Content Deployment (1) Content Type (1) DOS (1) Document Library (1) Drive Sapce (1) Excel Services (1) Export to Excel (1) Feature (1) GAC (1) Get-SPContentDatabase (1) Get-WmiObject (1) HTML calculated column (1) ISA2006 (1) IT Knowledge (1) ITIL (1) Install (1) Link (1) MCTS (1) Macro (1) Masking (1) Migration (1) NLBS (1) Nintex (1) Office (1) Open with Explorer (1) ROIScan.vbs (1) Reporting Services (1) SPDisposeCheck.exe (1) SQL Instance name (1) SSRS (1) Sandbox (1) SharePoint Online (1) SharePoint farm (1) Shared Services Administration (1) Site Collection Owner (1) Site template (1) Skype for business (1) Steelhead (1) Teams (1) URLSCAN (1) VLOOKUP (1) WSS SP2 (1) XCOPY (1) abnormal incident (1) admi (1) app (1) application pool (1) aspx (1) availabilty (1) backup (1) binding (1) blob (1) branding sharepoint (1) cache (1) calendar (1) change password (1) connection (1) copy file (1) counter (1) crawl (1) custom list (1) domain security group (1) event (1) excel 2013 (1) facebook (1) filter (1) fun (1) group (1) iis log (1) import (1) import list (1) improment (1) interview (1) keberos (1) licensing (1) log in (1) metada (1) migrate (1) mossrap (1) notepad++ (1) onedrive for business (1) operation (1) owa (1) process (1) publishing feature (1) resource (1) send email (1) size (1) sps2003 (1) sql201 (1) sql2012 (1) sub sites (1) system (1) table (1) task list (1) today date (1) trial (1) vbs (1) video (1) web part (1) web server (1) widget (1) windows 2008 (1) windows 2012 R2 (1) windows Azura (1) windows account (1) windows2012 (1) wmi (1)

Wednesday, February 16, 2011

Introduction to workflows

Microsoft Office SharePoint Designer 2007 another article from Microsoft

 

Across your enterprise, teams use Microsoft SharePoint sites to collaborate on documents and share information. You want to build a SharePoint application that improves team productivity and efficiency, but you don’t want to write code. Where do you start?

With Microsoft Office SharePoint Designer 2007, you can design workflows that add no-code application logic to your SharePoint sites and applications. Using the Workflow Designer, you create rules that associate conditions and actions with items in SharePoint lists and libraries. Changes to items in lists or libraries trigger actions in the workflow.

For example, suppose that a team's primary responsibilities are writing, revising, and approving contracts. These contracts are stored in document libraries on the team site. With Office SharePoint Designer 2007, you can create a workflow that sends a notification e-mail message to the reviewer when a new contract has been uploaded to the site. At the same time, the workflow creates a task in the Tasks list for the reviewer. When that person reviews the contract and marks the task as complete, different actions are triggered depending on whether the contract is assigned a status of Approved or Rejected.

Team efficiency and productivity improve because the workflow drives the process so that the team can focus on doing the work, rather than on managing the workflow. And no programming is required to build such a solution. By creating rules in the Workflow Designer, you can quickly add interactivity to a SharePoint solution or application.

This article introduces the basics of workflows. When you understand the basic building blocks of a workflow — events, actions, conditions, and steps — you can quickly add application logic to your SharePoint applications.

IMPORTANT   To create a workflow, your SharePoint site must be located on a server running Windows SharePoint Services 3.0.

In this article

What is a workflow?

Your team uses a SharePoint site to collaborate and store valuable business information in SharePoint lists and libraries. With Office SharePoint Designer 2007 , you can now attach application logic to documents or items in these lists and libraries.

With the Workflow Designer, you can attach a sequence of conditions and actions to a list or library — this sequence is a workflow. A workflow is a natural way to organize and run a series of actions that correspond to a work process. This process can control almost any aspect of a list item in Windows SharePoint Services 3.0, including the life cycle of that item. The workflow can include both actions performed by people (or workflow participants) and actions performed by the workflow. Workflow participants can interact with the workflow through the Tasks list, where a workflow can create a task for someone and remain paused until the task is marked complete.

Workflows can be as simple or as complex as your business processes require. You can create a workflow that the user initiates, or a workflow that is initiated automatically based on an event, such as when a list item is created or changed.

In general, when you use Office SharePoint Designer 2007 to design a workflow, you follow these basic steps:

  • Use the Workflow Designer to choose and assemble the conditions and actions that define the steps of the workflow.
  • Have Office SharePoint Designer 2007 automatically generate any ASP.NET forms for workflow initiation or any custom SharePoint task, if necessary.
  • Customize the workflow forms, if necessary.

You can think of a workflow as a flowchart of actions with a beginning, an end, and a sequential flow from start to finish. Workflows can incorporate parallel branches, but ultimately they progress from the initial action to the final action.

For example, suppose you were to chart the workflow described earlier that routes a document in Windows SharePoint Services 3.0 for approval. When the workflow starts, it automatically notifies the specified reviewer by e-mail that they have a document to review. The reviewer then reviews the document, and changes the status of the document to indicate that they have completed their task, and whether they have approved or rejected the document. Based on the reviewer response, the workflow proceeds down one of two parallel branches. If the reviewer approves the document, the workflow moves the approved document to a specific document library, and then sends an e-mail message to the entire team notifying them of the approved document. If the reviewer rejects the document, the workflow notifies the document author of this. In either case, the workflow then reaches its end and the process is completed.

Workflow process flow chart

Top of Page TOP OF PAGE

What are events, actions, conditions and steps?

These are the building blocks of a workflow. A workflow consists of one or more steps, and each step consists of actions and any associated conditions. Each workflow is initiated by an event.

WHAT ARE EVENTS?

An event is what starts or initiates a workflow. There are exactly three events that can start a workflow:

  • An item is created.
  • An item is changed.
  • A workflow participant clicks a start button on the SharePoint site.

It is important to understand that a workflow created with Office SharePoint Designer 2007 is always attached to exactly one list or library in a SharePoint site. When you design a workflow, you choose which list to attach it to. An event in this list starts the workflow.

You can create a workflow that a participant starts manually, or a workflow that is started automatically when a list item is created or changed. For example, in the document approval workflow, you want to design the workflow so that it starts automatically whenever someone adds a document to the Shared Documents library. On the File menu, point to New, and then click Workflow. In the Workflow Designer, you see the following page.

Define workflow - document approval

When a workflow participant starts a workflow manually, that person first browses to the list or library that the workflow is attached to. Any person with at least the Contribute permission level can initiate a workflow that is designed to start manually. The participant clicks an item, clicks Workflows on the menu, and then chooses a workflow from a page that displays all workflows associated with that item. The participant fills out a workflow initiation form, if necessary, and then initiates the workflow by clicking the start button on the form. Initiating a workflow creates a new instance of that workflow for that specific item.

Workflow command on list item

NOTE   The Workflows command is available only when the item is in a list or library that has at least one workflow attached to it.

For a workflow that is started manually, the initiation form can be as simple as the following.

Example of workflow start button on list item

You can also add custom fields to an initiation form when you design the workflow. Workflow participants can then provide information to the workflow by filling out this form, and those settings are passed to the workflow. A new workflow instance starts, and that workflow can then look up and use the information provided through the form at any point in the workflow.

WHAT ARE ACTIONS?

An action is the most basic unit of work in a workflow. Office SharePoint Designer 2007 provides a set of ready-made, reusable actions for you to incorporate into your workflow. For example, your workflow can:

  • Create, copy, change, or delete list items (including documents).
  • Check items in or out.
  • Send an e-mail message.
  • Create a task for someone on the Tasks list of your team site.
  • Collect data from a participant that can be referenced later in the workflow.
  • Pause or stop the workflow.
  • Log workflow information to a History list to use for repudiation or workflow debugging.
  • Set workflow variables or perform calculations.

A workflow can contain any number of actions. The actions just listed are performed by the workflow, but other actions might be performed by workflow participants. For example, the document approval workflow is comprised of five actions. Four of these actions are performed automatically by the workflow, but one of these actions — actually reviewing the document — is done by a workflow participant. Actions done by a workflow participant are represented by tasks assigned to that person in the Tasks list. The five actions in the example workflow are:

  • Send an e-mail message to notify the reviewer
  • Review the document (a task assigned to a workflow participant)
  • Move the document to the Approved document library
  • Send an e-mail message to notify the team
  • Send an e-mail message to notify the document author

In the most basic sense, when you design a workflow, you identify the necessary sequence of actions, and then you assemble that sequence of actions by using the Workflow Designer. For example, in the document approval workflow, the first action that you want is to send an e-mail message to notify the reviewer.

Flowchart, send e-mail to reviewer

So in the Workflow Designer, you choose that action for the first step in the workflow.

Actions list

WHAT ARE CONDITIONS?

When you design a workflow, you can use the Workflow Designer to create rules that apply conditional logic to SharePoint lists and items. A rule establishes a condition where the workflow performs the associated action only if that condition is true. For example, you can create a rule where the workflow sends a reviewer an e-mail message only if an item is created by a specific person. You can also add clauses to a condition. For example, you can create a rule where a reviewer is sent an e-mail message only if an item is both (1) created by a specific person and (2) the document title contains specific keywords. Finally, you can associate multiple actions with one condition. For example, you can create a rule where if an item is created by a specific person, then (1) the reviewer is sent an e-mail and (2) workflow information is logged to the History list.

Choose conditions and actions

To sum up, a rule is a condition associated with one or more actions: If all clauses in the condition are true, do all the associated actions.

In the previous example, the user specified only one condition. However, you can create multiple conditions for a step in the workflow. Multiple conditions create branches in the workflow: If condition A is true, do one action; if condition B is true, do a different action. To add a branch to a step, click Add 'Else If' Conditional Branch. For example, in the document approval workflow, if the reviewer approves a document, the workflow performs one action (or series of actions); if the reviewer rejects a document, the same workflow performs a different action. This is a conditional branch.

Flowchart example, approver reviews document

In the Workflow Designer, this step has two branches and looks like the following. The green diamond indicates that the step has a conditional branch.

Conditional branch with two conditions

You can also create a branch that has no specific condition. This way, the workflow performs one action if a condition is true and a different action if the condition is false. For example, the following step in a workflow sends a message to the team only if the condition is true; else, the workflow sends a message just to the document author. By adding a branch with no specific conditions, the workflow performs the action in that branch in any case where the condition in the first branch is false.

Conditional branch with no second condition

NOTE   Branching in a workflow cannot extend from one step to another. A set of 'Else If' branches is always contained in a single step.

Office SharePoint Designer 2007 provides several ready-made, reusable conditions for you to incorporate into your workflow. For example, you can specify that the workflow performs the associated actions only if an item:

  • Is created or modified in a specific time span.
  • Is created or modified by a specific person.
  • Has a title field that contains specified keywords.
  • Is a file of a specific type or has a file size in a specific range. (This condition is available only when the workflow is attached to a document library.)

In addition, you can create custom conditions and advanced conditions where you can specify a wide range of parameters. With custom conditions, you can compare a field in the current list with a value. For example, you can create a custom condition where if the Approval Status field equals Approved, do the associated action. With advanced conditions, you can compare one value to another value. This allows you to create a comparison between a field in any list and a value from another list. For example, you can create an advanced condition for the Shared Documents library where if the value of the Status field in the Tasks list equals Pending, do the associated action.

NOTE   An action does not require a condition. For example, the first step of the example document approval workflow sends an e-mail to notify the reviewer. This action does not have a condition associated with it.

PARALLEL VS. SERIAL ACTIONS

When you have more than one action associated with a condition, the actions can be set up to run at the same time (parallel) or one after another (serial).

Run actions in parallel or serial

Serial actions    For example, in the document approval workflow, you can set up two actions so that when a document is approved, a message is sent and then (afterward) the document is copied to the Approved document library. In the Workflow Designer, then indicates that the second action occurs after the first.

Serial action with 'then'

Parallel actions    For example, in the document approval workflow, you can set up two actions so that when a document is approved, a message is sent and (at the same time) the document is copied to the Approved document library. In the Workflow Designer, and indicates that the second action occurs at the same time as the first.

NOTE   Parallel actions are not absolutely simultaneous; the exact order cannot be specified and may vary each time the workflow runs.

Parallel action with 'and'

NOTES

  • In any given rule (conditions and actions), all actions must be either serial or parallel.
  • A set of serial or parallel actions must be contained within a single step.
WHAT ARE STEPS?

A workflow is comprised of one or more steps. Each step can contain any number of actions and associated conditions. You can think of steps simply as pages in the Workflow Designer. For example, the document approval workflow has two steps, as shown in the Workflow Designer.

Workflow steps, add a step

Steps allow you to group conditions and actions so that one set of rules (conditions and actions) can be evaluated and performed before a second set.

One step or many? Some workflows can be designed either as a sequence of actions within one step, or as a sequence of steps.

For example, the following three actions could be Step 1 of a basic one-step workflow.

Multiple actions in one step

The same three actions could be separated into several steps.

Multiple actions in many steps

How you structure your workflow into steps depends on what you want each step to accomplish. The rules in one step are processed to conclusion before going on to the next step, so you want to group in the same step any rules necessary to effect the specific action or actions that you want.

More specifically, each step can hold one set of 'Else If' conditional branches, where the actions in each branch are performed only when the associated condition is satisfied. In this case, additional steps are needed only when:

  • Multiple sets of 'Else If' conditional branches need to be evaluated.
  • You need to separate a branched statement from a non-branched statement.

You can also use steps simply as a way to organize your workflow. For example, a workflow might have many actions in a step that doesn't use conditions. In this case, you might want to separate the actions into steps just to better organize them.

Top of Page TOP OF PAGE

What are workflow forms?

To make your workflow more dynamic and flexible, you can add a form to the workflow. With a form, you can collect information from workflow participants at predefined times in the workflow, and make it possible for participants to interact with the tasks for that workflow.

With Office SharePoint Designer 2007, you can create two types of workflow forms:

  • An initiation form gathers information from the workflow participant when they start the workflow. Initiation forms are displayed to users when they manually start a workflow on a given SharePoint item. With an initiation form, users can specify additional parameters or information about the workflow as it applies to the given SharePoint item. For example, you might use an initiation form to ask who should review a document and by when the review should be completed. Not all workflows need initiation forms. If you do need one, Office SharePoint Designer 2007 automatically generates an ASP.NET initiation form according to your initiation specifications.
  • A custom task form allows workflow participants to interact with tasks in the Tasks list on a SharePoint site. With the Custom Task Wizard, you can easily create custom form fields and add them to a custom task form. When you finish designing the workflow, Office SharePoint Designer 2007 automatically generates the ASP.NET forms for your custom tasks. Then, when the workflow runs and tasks are created, the user browses to the Tasks list on the SharePoint site, marks the task as completed, and enters any optional or required information specific to the workflow. The workflow can then respond to those changes as specified in the workflow, or look up and evaluate that information in later steps of the workflow.

After Office SharePoint Designer 2007 automatically generates the ASP.NET forms, you can customize them. Workflow forms are ASP.NET pages with a Data Form Web Part and a master page applied to it. These .aspx files are stored on the SharePoint site with the workflow source files. You can open and customize these forms as you would any other .aspx file.

Top of Page TOP OF PAGE

Where are workflows stored?

Workflows are stored in a site-level document library called Workflows. This document library is created automatically by Office SharePoint Designer 2007. In the Folder List, the Workflows document library displays the workflow icon instead of the usual list or document library icon. By default, the Workflows document library is hidden from the browser and has no List Views, such as AllItems.aspx or EditForm.aspx. This document library contains a folder for each workflow created with Office SharePoint Designer 2007. The folder contains all the source files necessary for the workflow, including:

  • The workflow markup (.xoml) file (needed only when the workflow uses conditions).
  • The workflow rules file.
  • The workflow configuration file.
  • Any .aspx forms needed, such as initiation forms (for workflows that are started manually) or custom task forms.

To modify an existing workflow, you can either click Open Workflow on the Filemenu or double-click the .xoml file in the Folder List. This opens the workflow to its first step in the Workflow Designer. If you click Back to view the initiation settings of the workflow, you see that you cannot change which list or library the workflow is attached to. After a workflow is attached to a list or library by using Office SharePoint Designer 2007, this association cannot be changed.

Workflows in folder list

The Workflow Designer provides an action called Log to History List. You might use this action when you want to keep a record of the workflow history for investigating errors or for tracking and repudiation purposes. When you create a workflow that uses the action Log to History List, Office SharePoint Designer 2007 automatically creates a list called Workflow History. This list has columns for such information as user ID, date, event, and error description. Like the Workflows document library, by default the History list is hidden from the browser but can be seen in the Folder List.

Workflow history in folder list

The Workflow Designer provides three actions that interact with the Tasks list: Assign a To-Do Item, Collect Data from a User, and Assign a Group Survey. When you create a workflow that uses any of these three actions, Office SharePoint Designer 2007 automatically creates the .aspx form, the content type for the task, and the Tasks list, if necessary. By default, the Tasks list can be viewed in the browser, unlike the Workflows document library and Workflow History list.

Tasks list in folder list

Top of Page TOP OF PAGE

Where can I check the status of a workflow?

You can easily view the progress of workflows on a selected item through the browser. The All Items view of a list or document library displays the current status of workflows running on an item. In addition, each item has a Workflows page where you can view the following information:

  • All workflows currently running on that item.
  • All workflows that have run on the item in the past.
  • All the available workflows for that item.

Workflows page for an item

To view the Workflows page for an item, click the item in the list, and then clickWorkflows on the menu.

NOTE   The Workflows command is available only when the item is in a list or library that has at least one workflow attached to it.

When a user starts a workflow on an item, Windows SharePoint Services 3.0 adds a new column to that item. By default, the column name matches the name of the workflow. This read-only column displays the current status of the item within that workflow. This status column is added automatically for each workflow the first time it is run.

Columns display workflow status

In each column, the workflow status is a link. When you click In Progress, for example, you see the Workflow Status page for that instance of the workflow.

Workflow status page

A workflow created in Office SharePoint Designer 2007 cannot be deployed to multiple lists. It is only valid for the list for which it was created. However, multiple workflows can be attached to one list and may be available for a given item. Multiple workflows can run simultaneously on the same list item, but only one instance of a specific workflow can run on a specific item at any given time. For example, you might have two workflows, Workflow A and Workflow B, available for a specific list. Although both workflows can run simultaneously on a specific item in the list, you cannot have two instances of Workflow A or Workflow B running on the same item at the same time.

No comments: