SharePoint Designer Workflow Overview
Last modified: April 11, 2010
Applies to: SharePoint Foundation 2010
To aid in the rapid design and deployment of workflows, the development process in a declarative rules-based, code-free workflow editor, such as Microsoft SharePoint Designer 2010, is much simpler than those workflows created in Visual Studio.
When you develop workflows for Microsoft SharePoint Foundation 2010 using SharePoint Designer 2010, you follow these basic steps:
Author your workflow by assembling and configuring the predefined activities and conditions available in SharePoint Designer 2010.
Have SharePoint Designer 2010 automatically generate ASP.NET forms for workflow initiation and any custom task in SharePoint Foundation, if necessary.
Customize the workflow forms, if necessary.
SharePoint Designer 2010 automatically generates the workflow definition template and deploys of the workflow to the specified list.
SharePoint Designer 2010 uses a wizard-driven interface that enables users to assemble sequential workflows from predefined activities. Users select activities from a predetermined list, and configure those activities using the SharePoint Designer 2010 interface. These activities can be the same activities that are present in the Visual Studio 2010 Workflow Designer; there is no difference in activities between the two tools.
In SharePoint Designer 2010, however, each activity appears as an action, represented by a sentence that contains variables that the user can configure using drop-down menus and lookup dialog boxes. Users can also select conditions, which are configurable conditional clauses that direct the flow of the workflow.
As the user is selecting and configuring conditions and actions in the workflow interface, SharePoint Designer 2010 generates the two files that actually represent the workflow class:
The workflow markup file, which contains markup language that describes the activities included in the workflow.
The workflow rules file, which contains the business logic of the workflow in declarative rules form, rather than as code.
Adding Custom Activities and Conditions
Because workflow authors in SharePoint Designer 2010 cannot create custom activities for use in their workflows, they are limited to the activities and conditions that the developer makes available on the ”safe list” (which should also be approved by a server administrator) that appears in SharePoint Designer 2010. Developers can create custom activities and conditions, and make them available on the safe list.
A condition is a custom assembly with a static method that when called, evaluates condition and returns a Boolean value.
To make activities and conditions available on the safe list:
Create the activity or condition, compile it as a strong-named assembly, and deploy it to the global assembly cache.
Add the activity or condition to the action safe list in the web.config file.
In the WSS.Actions file, located in the workflow folder, add rules and parameters for the sentence that represents the activity or condition in the SharePoint Designer 2010 user interface. This is markup language that specifies how the activity or condition appears and performs in the interface, because this information is not present in the activity or condition assembly itself.
For more information about deploying custom activities and conditions, see the SharePoint Designer 2010 help.
Generating ASP.NET Forms in SharePoint Designer
You can create an initiation page for your workflow in SharePoint Designer 2010. If you do, SharePoint Designer 2010 uses ASP.NET to automatically generate an initiation form according to your initiation specifications.
Similarly, you can create custom Microsoft SharePoint Foundation 2010 tasks for your workflow. Again, SharePoint Designer 2010 automatically generates an ASP.NET form for the task, according to your specifications.
These ASPX forms are stored on the SharePoint site with the workflow source files. You can open and customize them as you would any other ASPX form.
Because you are authoring against a specific list, the deployment of workflows you create in SharePoint Designer 2010 is a much simpler process than workflows you create in the Microsoft Visual Studio 2010 Workflow Designer. SharePoint Designer 2010 deploys the workflow to the specified list.
SharePoint Designer 2010 offers no custom debugging functionality.
Deleting a workflow authored in SharePoint Designer 2010 from a list does not delete the actual source files used to compile that workflow from memory. The workflow is no longer associated with the list, but the source files remain stored in the workflow document library on the site.
In the SharePoint Foundation object model, workflows authored in SharePoint Designer 2010 are indistinguishable in appearance from workflows authored in the Visual Studio 2010 Workflow Designer.