WSS (Windows SharePoint Services) Workflow with ASPX Task Forms Tutorial – Part 1

WSS (Windows SharePoint Services) Workflow with ASPX Task Forms Tutorial – Part 1

Dear readers,

This is one of the areas I really struggled in when I moved from creating SharePoint & InfoPath form based workflows to creating WSS workflows that use ASPX pages for task forms.

Because WSS does not include ‘Forms Services’, the technology which allows the use of InfoPath forms in a web browser, the only real solution is to create some aspx pages to use for the task forms.

While looking round on the net, I noticed there was a lack of any workflow tutorials for WSS so I have decided to create a four part tutorial. In this tutorial in we will create a simple workflow allowing us to explore the steps required to develop workflows for the WSS platform.

In Part 1 of the tutorial we will look at a simple workflow process and will set up our Visual Studio project and batch file. In Parts 2 and 3 we will code the solution and in Part 4 we will deploy the solution to WSS.

Before we start I’d like to point out some of the annoyances I have encountered with ASPX based workflows:

  • You cannot visually design the ASPX pages if you inherit from the SharePoint default and application.master pages, the best way to get around this is to design the pages in a separate Visual Studio project and then copy the code over.
  • Any task that contains different fields/metadata will need its own Content Type, this means if you have a large workflow you will have many Content Types.
  • When you create a task using a ‘CreatetaskwithContentType’ activity it does not associate the Content Type to the Task list for you, you will need to run some code before the activity to add the Content Type at runtime.

Other than the above, I cannot find much more to complain about :p.

So, let’s imagine that we need to create a workflow to mimic the process below:

Workflow Flow Diagram

As you can see this is a fairly simple approval process, we can add a number of log activities throughout the workflow to enhance it further.

As you probably already know, there are two types of SharePoint/WSS Workflow – Sequential or State Machine.

  • Sequential – These are workflows that progress in a flowchart style nature and cannot go back in the process.
  • State Machine – These workflows progress from ‘State’ to ‘State’ and can go back at anytime in workflow. There is greater flexibility.

We will use State Machine for this tutorial as when the item is rejected, we need to go back to the previous task. We now need to configure Visual Studio, I will use Visual Studio 2008 for this tutorial, however you can use 2005 if needed.

Begin by creating a blank C# State Machine Library Project in Visual Studio:

Visual Studio New Project

Configure the solution explorer like the below example by adding the relevant folders, this will help us when we come to deploy our workflow to WSS.

In addition rename the Worklow1 class to something more meaningful and strongly sign the assembly to create an .snk file by using the Project > Signing dialog box.

Visual Studio Solution Explorer

We will use the Features directory to store the feature files, Images for any custom images we might add and the Layouts to store our ASPX forms.

This is the end of Part 1, stay tuned for Part 2 within the next few days!!

9 thoughts on “WSS (Windows SharePoint Services) Workflow with ASPX Task Forms Tutorial – Part 1

    1. alex350r

      Hi Sean,

      I’m afraid there is no Part 2 yet, I haven’t got round to creating it, I will probably post it here early next week. When I do, I will add a link here to the new part.

      Thanks,

      Alex

  1. alex350r

    Craig i’m afraid it’s not done yet, however I know this is one of the most viewed blog posts on here so I probably need to get it done asap.

    I will try to do parts 2 and 3 one evening this week.

    1. alex350r

      Hi Clement,

      I’m afraid the other parts weren’t published – I had planned to but never got round to it. I’ll do my best to publish part 2/3 soon if I can.

      Cheers,

      Alex

    2. alex350r

      Hi Clement,

      I’m afraid the other parts were not published. I keep reminding myself that I must get this done as this is the most popular post on my blog!

      Thanks,

      Alex

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">