Tuesday, November 9, 2010

My Favorite new SharePoint 2010 Workflow Features


What's new for Workflows with SharePoint 2010?

With the release of SharePoint 2010, there is a host of new workflow functionalities available. This is especially true for custom workflows, where a few of the new features radically make developing workflows much easier. Take, for example, the introduction of Reusable Workflow. With 2010, workflows can now be deployed in a reusable fashion from within SharePoint Designer, which enables users of Designer to be much more efficient in their work. In the 2007 product, they used to have to literally recreate each workflow onto every list instance that they wanted it to be deployed onto. Now with 2010, a workflow only needs to be created and maintained in one place, and it can be installed onto many lists and receive updates if the original workflow is edited. In addition to reusable workflows, there are many more great enhancements that have been made to workflows in the 2010 release. Some of the key improvements follow.

Office Visio 2010 SharePoint Workflows

Bar none, the new functionality in Office Visio 2010 will bring the most smiles for SharePoint Business Analysts. With Visio 2010, you can now model out your SharePoint workflows and leverage that model to help elicit business approval. The best part is that, after you've solidified that high level flow, you can export the workflow as a template and import it into SharePoint Designer and start building out the steps! This will greatly improve the efficiency of requirements gathering and translation to developers.

Customizing the Out-of-Box Workflows

Have you ever used an out-of-box workflow in SharePoint 2007, but it didn't quite do just what you needed it to do? If this statement is true for you, you'll be pleased to hear that these out of box workflows can be customized in SharePoint Designer 2010 (figure below).

Whether it is an existing instance of an out-of-box workflow or if you want to create a new workflow off the out-of-box template, there exists now this flexibility in the 2010 product.

New Actions and Conditions Available in SharePoint Designer

There's a host of new out-of-box conditions and actions available in SharePoint Designer 2010. A couple of the highlights are that you can now manage permissions in a workflow (just think of the possibilities here!) and interface with Records center to accommodate retention policies. 


Reusable Workflows

As mentioned in the introduction to this subtopic, reusable workflows can now be created and deployed to the site or site collection level and be consumed by various objects within that scope. The major benefit here is that you no longer need to maintain more than one copy of the same workflow.

Site Workflows

Site Workflows takes the concept of reusable workflows a step further. In addition to a workflow's capability to run on a list, library, or list item within a site, a Site Workflow can run on the site itself. A good business example of this is a workflow that needs to ensure that all documents on the entire site, regardless of the list where they reside, have been approved. A site workflow could iterate through all the libraries and check if each document has been approved or not. There is a host of other applications for deploying a workflow within this scope as well.

Workflow Templates in SharePoint Designer

In SharePoint 2007 you couldn't move a SharePoint Designer workflow from one farm to another. So if you have a Dev, Test, and Prod set of farms, you couldn't prototype a workflow, in say Dev, and then promote it to Prod. Now in 2010 you have the ability to save a workflow as a template (WSP file), and export and import that template into another farm!

Task Processing Customization

In most workflows, tasks are delegated to certain individuals. When a task is assigned, the workflow will typically wait for an action to occur upon that task, in which case the workflow will resume processing. In SharePoint 2007, the nature of this task processing was pretty static, meaning that you could not alter the way the out-of-box workflows handled tasks and events associated with them. However, in SharePoint 2010, you can now fully customize what actions you want when various task events occur. A few of these events are when a task is assigned, expired, deleted, and completed. Now, when each of these events occurs, you can inject your own custom activities to change the way the task processing flows.

Viewing Workflow Status with Visio Web Access

A neat new reporting feature that is available in SharePoint Server Enterprise edition is the ability to view a workflow's status through a Visio diagram. If you first build your workflow in Office Visio 2010 and then import that workflow into SharePoint Designer, you can enable Visio web access on that workflow. Throughout the workflow's lifecycle, the Visio diagram will dynamically update to reflect where the workflow is currently executing. Notice the green checkboxes in the figure below.

You can see the path that the workflow has taken and where it is executing. In this case, it has finished executing.

Importing SharePoint Designer Workflows in Visual Studio

A stunning new feature that comes with 2010 is the ability to export a SharePoint Designer workflow and thereafter import that workflow into Visual Studio (figure below).



This is very powerful because, oftentimes, you may first create a workflow in SharePoint Designer since it is such an easy tool to use. However, after a year or so goes by, you may realize that your business requirements have changed and become more complicated, necessitating a Visual Studio workflow. In SharePoint 2007, you would have had to recreate the SharePoint Designer workflow from scratch within Visual Studio, but now, because of the new export/import functionality, you won't lose those valuable man hours that it took to build the Designer workflow.

Visual Studio 2010 Environment Improvements

There's no doubt that building custom workflows within Visual Studio has gotten dramatically easier with the 2010 releases of SharePoint and Visual Studio. Many would consider that most of the effort to build Visual Studio 2008 workflows in SharePoint 2007 was around the packaging and deployment of the workflow itself. You can to build all the features, DDFs, manifests, keys, tokens, GUIDs, and everything else by hand! This is no more with Visual Studio 2010 – all the necessary features and solution packages necessary to deploy the workflow into SharePoint are generated for you manually. Just right click and deploy!

Pluggable Workflows

In SharePoint 2007, there was no easy way for running workflows to receive updates from the outside world. With the new pluggable capabilities that come with SharePoint 2010, workflows can now execute up to a certain point, and then wait for information from an external process. The developer simply needs to implement an event handler or web service of some sort to handle the request of the external process and thereafter respond by calling into a method within the workflow itself, informing it to continue processing.

New Event Handlers

A couple new event handlers are present within SharePoint 2010, and that's the ability to react to a workflow's initialization or completion. These handlers may be external to the workflow or embedded within the workflow itself. For instance, you may want to fire some code that logs in a centralized repository every time a workflow of a certain type has been started and when it is completed. With these new event handlers, this is easily possible. 

No comments:

Post a Comment