Creating SharePoint Workflows with WSPBuilder and WSS

As I mentioned in my previous post, WSPBuilder is a great tool for SharePoint development. Between its built-in commands and its project templates, it takes a lot of the hassle out of setting up SharePoint configuration files for your features and solutions.

However, it’s a little tricky to get it working for workflows, especially if you’re using Windows SharePoint Services instead of MOSS. Here’s what I eventually worked out:

  • Make sure you’re using the “WSPBuilder Project with Workflow” template for your project. I made this mistake this first time through, and nothing worked.
  • Remove references to Microsoft.Office.* Pull out the “ReceiverClass” and “ReceiverAssembly” references in feature.xml; you don’t need them anyway for a basic workflow. (If you do, you can always add them in later.)
  • Remove the AssociationUrl, InstantiationUrl, and ModificationUrl attributes from elements.xml. You’ll need to add them back in if you create forms for this workflow, but not for a basic workflow.
  • Dylan Wolf

    I made one other discovery today… you have to add the following code to the default WSPBuilder template, or your workflow does nothing when you try to start it. No error, no exception, nothing. Quite confusing.

    private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
    workflowId = this.workflowProperties.WorkflowId;