Tuesday, February 15, 2011

Workflow enhancements in SharePoint 2010

In Windows SharePoint Services 3.0, there are plenty of options and activities added in Workflows. And it is easy to create our own custom activities or workflows and deploy to SharePoint 2007. Now, they have extended the workflow functionality and added new activities, events and services. Along with them there are two wonderful concepts they came up with. They are Site Workflows and Reusable Declarative Workflows.

  • Please read this article for knowing all New activities.
  • Workflow Events: This will be very helpful feature and solves many problems in SharePoint 2010. Through this feature you can call another workflow and know the other workflow status and proceed accordingly and there are pre-event handlers available as well, and they help to check to start a workflow whether we have valid data or not etc.. Adding workflow events is same as writing other event receivers. We have to use SPWorkflowEventReceiver class for it. What are the available events:
    • WorkflowStarting
    • WorkflowStarted
    • WorkflowCompleted
    • WorkflowLoading
    • WorkflowUnloading
    • WorkflowPostponed
  • Workflow Service: A new class added to SharePoint 2010 is SPWorkflowService. Which is abstract class and provides basic functionality to get some information of a workflow. By using this service you can communicate with the workflows running in a site. For example, if there is a need that workflow has to wait depends on some external process status and depends on the external process status it has to wait or continue then we have to use this workflow service. With this new architecture it is very easy to solve some complex business processes.
  • Site Workflows: We already know and worked on workflows on a list. The same way now you can add workflows on a site as well. Through SharePoint Designer 2010 it is very easy to create site workflows from UI. Whereas if you want to create site workflow through Visual Studio 2010 then you don’t have direct option to create site workflows. Once you built the workflow then you have to manually edit workflow.xml file as shown below.


  • Reusable Declarative Workflows: In earlier versions of SharePoint, we can associate a workflow with a specified list or library. We cannot use same workflow and apply it to all lists or libraries. But, in this version declarative workflows are reusable and you can apply same workflow for one list to multiple places.

No comments:

Post a Comment