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).
Continues…

Pages: 1 2




Array

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