SharePoint / ASP.Net Development
Experiences from the field...
Navigation
   RSS 2.0
Categories
Entries by Month

# Wednesday, March 12, 2008

I am working on getting a community site up to host these articles as well as the code. My hope is that all interested developers will contribute their solution to the various Actions that can be selected in SharePoint designer.

This post is the first in a series. The series will discuss the porting steps as we presented in Seattle, but with the details filled in. (We had only 75 minutes to present, which is way too little.) Part 1 will discuss the virtual machine setup and the creation of the SharePoint Designer workflow that will be ported.

Virtual Machine Setup

When a workflow is created in SharePoint Designer, the site is updated with a few pieces that enable it to work. We want to ensure that we port all of these pieces, so we will be using two different web applications. The first at http://spdflow will be used for the SharePoint Designer workflow. The second at http://vsflow will host the Visual Studio workflow. Rather than use different port numbers for the web application, the hosts file (C:\WINDOWS\system32\drivers\etc\hosts) is updated with each of these host names.

The virtual machine will also have the necessary applications installed: SharePoint Designer 2007 and Visual Studio 2005 with the Office SharePoint Server 2007 SDK.

SharePoint Designer

We will use SharePoint Designer to create a workflow. The workflow will perform the most popular actions -- collecting data, creating a task and writing to the history list. This is accomplished via the following steps:

  • In SharePoint Designer, open the site http://spdflow.
  • Click File | New | Workflow. The Workflow Designer wizard is displayed.
  • Name the workflow SPDFlow and attach it to the Announcements list. Leave the start options at the default, which is manually. (We'll be starting it often.)

  • Click on the Initiation button on the bottom
  • Add a Workflow Initiation Parameter named InitiationField with a default value of Barracuda. Then click OK

  • Back in the Workflow Designer wizard, Click Next.
  • In Step 1, click on the Conditions button and choose Compare Announcements field.

  • Choose the Modified By field and the account name of the current user.

  • Click on the Actions button and choose Collect Data from User.

  • Click on the "data" link to invoke the Custom Task Wizard.

  • Enter "Collect Data Task" for the task name and click Next

  • Click Add to create a field.

  • Name the field "TaskField" and enter a default value of "DeliverPoint"

  • Click Finish on the Custom Task Wizard. You will receive a warning about running instances, which can be ignored.
  • Click on the "this user" link in Step 1 Actions. Select the account name for the current user.

  • Click on the "Variable: collect" link in Step 1 Actions. Rather than put the data in a generically named variable called "collect," choose "Create a new variable" and name it "ListItemID"

  • Click on the Variables button at the bottom of the Workflow Designer form. Even though we did not choose the variable named "collect," it was created for us. Remove it, and any other unused variables, from the list.
  • Click Finish.

SharePoint Designer will save the workflow and associate it with the Announcements list. Test the workflow by returning to the browser and navigating to the Announcements list.

  • On the context menu of a list item, select Workflows

  • On the Workflows page in the Start a New Workflow section, click on the name of the workflow (SPDFlow)

  • The initiation form is displayed. Click Start

  • The Announcements list is displayed, with a new column on the far right. The column name matches the name of the workflow and the value is "In Progress"

  • Click on "In Progress" to display the Workflow Status page

  • In the middle of the page is the name of the task: CollectDataTask. Click on this link to display the task.

  • Click on Edit Item in the tool bar. This will display the custom task edit form for this workflow

  • Click on Complete Task

    At this point we have a workflow that was created in SharePoint Designer. The next post is this series will move us further along our path. Stay tuned!

Wednesday, March 12, 2008 5:33:00 AM (Central Standard Time, UTC-06:00)  #    Comments [0]  | 
Search

Further Reading...

Powered by: newtelligence dasBlog 2.2.8279.16125

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008, Paul Schaeflein

Send mail to the author(s) E-mail