Windows Workflow and SharePoint technology

From Service-Oriented Architecture and RFID to Web services, XML, and beyond, Youngland is at the cutting edge of technology.

 

History

Windows SharePoint Services (WSS) 2007 is the first Microsoft server that has native support for the Windows WorkFlow Foundation (WF). The integration of WF and the 2007 release of SharePoint provides an infrastructure that drives processes around SharePoint's strong suit: collaboration and sharing of information. This release focuses on document-centric workflows, the procedures that a particular document goes through in its lifecycle (be they reviewing, editing, or approval). It enables you to attach and run a process directly in a SharePoint document or list item. Additionally, the workflows within SharePoint spotlight human-based endeavors, tasks driven by human interaction as opposed to static, automated programmatic steps.

 

Windows Workflow Foundation

Windows Workflow Foundation (WF) is a Microsoft technology that provides an API, an in-process workflow engine, and a rehostable designer to implement long-running processes as workflows within .NET applications. The current version of WF was released as part of the .NET Framework. A workflow, as defined here, is a series of distinct programming steps or phases. Each step is modeled in WF as an Activity. The .NET Framework provides a library of activities (such as WriteLine, an activity that writes text to the console or other form of output). Custom activities can also be developed for additional functionality. Activities can be assembled visually into workflows using the Workflow Designer, a design surface that runs within Visual Studio. The designer can also be hosted in other applications. Encapsulating programming functionality into activities allows the developer to create more manageable applications; each component of execution can be developed as a Common Language Runtime object whose execution will be managed by the workflow runtime.

 

A Useful Case Study

A standard Visual Studio installation lacks the necessary tools to work with the WorkFlow Foundation, so to put things in motion you must install the Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation). The extensions provide the required references to the Foundation assemblies, the essential Activities needed, as well as the WorkFlow designer within Visual Studio and a number of project templates. (Keep in mind that you must install DotNet Framework 3.0 as a prerequisite to working with WF.)

 

A Visual Studio 2005 extension that is compatible with the WorkFlow Foundation to work with SharePoint is available. Note that this extension is not required if you are developing workflows for SharePoint (the extension makes a new template to initialize a project).

The first step in creating a workflow for SharePoint is crafting a new project in Visual Studio 2005 based in the Sequential Workflow Library (or in the State Machine Workflow Library, if you are making a state machine workflow) and assigning it a name. Visual Studio will generate the necessary code and configuration files. Add a reference to Windows SharePoint Services (Microsoft.SharePoint.dll) and, if you need to work with Microsoft Office SharePoint Server, a reference to Microsoft Office SharePoint Server component (microsoft.sharepoint.portal.dll). This establishes references to the object model of SharePoint, opening the door to interactions with it.

Although it's not compulsory, it simplifies coding if you write directives to the next namespaces in the code behind file, for example:

 

    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Workflow;
    using Microsoft.SharePoint.WorkflowActions;

 

Finally, you need to add an activity to the Visual Studio toolbox. Using the context menu (right-click into the toolbox), select Choose items and in the .NET Framework Components tab, check the OnWorkflowActivated activity to activate it in the toolbox. This activity is indispensable for running workflows in SharePoint.

The following example builds a simple workflow that illustrates the lifecycle of a WF within SharePoint: initializing the workflow, transporting information from SharePoint, processing it, and feeding it back to WSS.


*This is an example WorkFlow in the Visual Studio WorkFlow Designer

You initialize the process by creating the workflow using the WorkFlow Designer in Visual Studio. The opening activity is always the OnWorkflowActivated for workflows in SharePoint. Next, install a While activity with a Code Activity inside to process the information. Finally, install another Code Activity to return information to SharePoint. Bear in mind that this is not a functional workflow you would use in a business application, but a demonstration of each part of the interaction between WF and SharePoint.

 Top of page


Case Studies

Read more what our clients saying about us

  Client Testimonials

  By Industries

  By Solutions

What is your challenge? and your Strategy? How about the results? Read our case studies for our clients success stories.

  Capital Management

  Construction Wholesale

  Oilfield Equipment

  Biotechnology

  Manufacturing

  Retail Distribution

 

At Youngland, customer satisfaction is highly prioritized because we firmly believe that taking care of customers takes care of business. Our staff is dedicated to bring you exceptional care and support. With this as our business model, we are dedicated in providing our customers with the best services because their satisfaction is our reward.

If you are interested in knowing more, please take a look at our SWITCH! Program that offers the product with FREE assessment and discount.

Youngland Computing It's About You