Wednesday, 25 May 2011

SharePoint 2007 to 2010 upgrade workflow task content type id issue

When upgrading from SharePoint 2007 to 2010 I came across a rather odd issue. A custom workflow was no longer using the custom WrkTaskIP.aspx page to host the InfoPath forms as it did in 2007. On closer inspection this was caused by the tasks created from the workflow not having the right content type (and the custom WrkTaskIP page was referenced in the workflow task content type xml file).

The content type for the tasks was now "Signatures Workflow Task Deprecated", and the custom task type was nowhere to be found anymore. It was missing from the content type gallery and SharePoint Manager 2010 would not list it even though it was in the content type table in the content db.

Poking around I finally realised the content type id for the custom workflow task, 0x01080100C9C9515DE4E24001905074F980F9316001, was the same as the content type id for "Signatures Workflow Task Deprecated". I couldn't find any references to this type in 2007, so presumably it's a new one in 2010 (even though the name would suggest it's been around for a while). The ID clash would have come about by the original creator of the custom workflow task type adding 01 to the id for the SharePoint Server Workflow Task instead of a GUID (which would have avoided this whole issue), and Microsoft doing the same with the ID for this new Signatures task.

The resolution to restore the custom task type and get the workflows working again was as follows: (changing the ID would potentially break existing workflows, so discounted in this case)

  • Check Usages for Signature Workflow Task Deprecated and delete all instances of it (including recycle bins)
  • Deactivate the SignaturesWorkflowSPD feature (this is hidden so stsadm, PowerShell or SM2010 are required)
  • Uninstall the SignaturesWorkflowSPD feature
  • Deactivate the custom workflow task content type
  • Uninstall the custom workflow task feature
  • Verify that both task types are no longer in the list of content types
  • Reboot all the servers (yeah I know, but IISRESET and restarting all services on the servers didn't cut the mustard)
  • Install the custom workflow task content type
  • Activate the custom workflow task content type
  • Verify that the custom workflow task content type is available in the content type gallery

This restored the workflow to its former 2007 glory. The main lesson learnt must be that if at all possible do use a GUID when creating a content type id rather than 01, 02 etc. And never forget to add 00 before your part of the ID.

Thanks go to the rather excellent James Mann for helping out with this issue, check out his blog here.

Update: Make sure you change your ID long term as this can resurface in various ways, including if you add another server to your farm.

No comments:

Post a Comment