Building Custom Workflows using SharePoint Designer 2010
SharePoint 2010 comes with several inbuilt workflow templates, such as one for document approval. Sometimes these templates are not suitable and new workflows need to be created. You can do this in one of the following ways:
- Using the SharePoint Designer.
- Designing the workflow in Microsoft Office Visio and importing into the SharePoint Designer.
- Writing programming code inside Microsoft Visual Studio.
Custom Workflows with the SharePoint Designer
In this article, we will explore the first approach. We will build a sample workflow that creates a new item in the Announcements list when someone uploads a document in a predefined document library. This will be accomplished without writing even a single line of programming code.
The first step is to create the document library where our custom workflow will run. To do this, select the “Site Actions” menu and then choose “New Document Library”. The dialog for creating a new document library will appear (see Figure 1). Enter“Rules” for the library name and optionally provide a description. Press the “Create” button and our new library will be created.

Figure 1 Create new document library
Now we are ready to build the workflow for the newly created library. To do this, start SharePoint Designer 2010 and select “Open Site” from the menu. Then enter the URL address of your SharePoint site (Figure 2). In the this example the SharePoint server runs on the same machine where we are running the SharePoint Designer, so we will use “localhost”.

Figure 2 Opening a site using SharePoint Designer
After a pause, the SharePoint Designer opens the site. To check what workflow templates are available, select the “Workflows” item from the “Site Objects” list (Figure 3). In this example only the default templates are available.
Now create a new workflow. We can choose from one of the following workflow types:
- List Workflow – this type of workflow can be attached only to SharePoint lists or libraries. This template comes in handy when the use-case is very specific and can be applied only to lists or libraries.
- Reusable Workflow – more flexible than the List Workflow and can be attached to a content type. Later this content type can be used in, for example, a list. In addition, workflows from this type can be imported into Visual Studio and enhanced with programming code.
- Site Workflow – this type of workflow operates on site level. For example, the List workflow operates over a SharePoint library. This workflow can operate over the overall site objects.
In this example, we will use the List Workflow. Click on the “List Workflow” and then select the “Rules” library. A new dialog will popup (Figure 4), where we provide the name of the workflow – “CreateAnnouncement”. Optionally you can provide description as well.

Figure 3 SharePoint Designer and Workflows

Figure 4 Create a new List Workflow
Now it is time to implement the steps in our workflow. Actually we will need to implement just a single step – create a new item in the announcements list. To do so, select the “Step 1” and start typing “cre”. Then press Enter (Figure 5). A lookup list with the possible actions will appear. We will select the first choice “Create List Item”. If you want, you can review all other actions you have at your disposal. However, in this simple example we will not be using these.
Next, configure the action we have just created. We will need to specify the target list (Announcements) and the item title and body. To do this, click on the “this list” from the action. A new dialog will appear where we need to select the “Announcements” from the top drop down list (Figure 6).

Figure 5 Implement step in the workflow

Figure 6 Create new list item dialog




13. Feb, 2010 







No comments yet... Be the first to leave a reply!