David Kitchen

Avatar

Just another SharePoint developer blogging

Workflow in SharePoint Project Server templates

Apparently this isn’t as simple as it should be.

The environment:

Project Server 2007 with SharePoint v3. Each Project has a SharePoint subweb as a “Project Workspace”. The Project workspaces are provisioned automatically by Project Server. Project Server applies a template to the new workspaces. The template can be customised but must be derived from the one Project Server originally shipped.

The scenario:

Put workflow into the template so that each provisioned Project workspace starts with a number of pre-defined processes

Shouldn’t be hard right? Well, it was.

The problem wasn’t making the very complex workflow in SharePoint Designer (which was amusing, and fun… 20 step workflow of many branches).

The problem was keeping the workflow working when the Project workspaces were provisioned.

What we saw was that all workflows in the provisioned sites would return with the error:

Failed on Start (retrying)

And digging around the SharePoint logs ( C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\Logs\ ) revealed that the error being thrown under the hood was:

RunWorkflow: Microsoft.SharePoint.SPException:
<Error>
	<CompilerError Line="0" Column="0" Text="Activity 'ID85' validation failed: Can not find the condition "__Rule_ID85"." />
	<CompilerError Line="0" Column="0" Text="Activity 'ID636' validation failed: Can not find the condition "__Rule_ID636"." />
	<CompilerError Line="0" Column="0" Text="Activity 'ID624' validation failed: Can not find the condition "__Rule_ID624"." />
	<CompilerError Line="0" Column="0" Text="Activity 'ID630' validation failed: Can not find the condition "__Rule_ID630"." />
	<CompilerError Line="0" Column="0" Text="Activity 'ID162' validation failed: Can not find the condition "__Rule_ID162"." />
	<CompilerError Line="0" Column="0" Text="Activity 'ID488' validation failed: Can not find the condition "__Rule_ID488"." />
	<CompilerError Line="0" Column="0" Text="Activity 'ID428' validation failed: Can not find the condition "__Rule_ID428"." />
	<CompilerError Line="0" Column="0" Text="Activity 'ID579' validation failed: Can not find the condition "__Rule_ID579"." />
	<CompilerError Line="0" Column="0" Text="Activity 'ID580' validation failed: Can not find the condition "__Rule_ID580"." />
	<CompilerError Line="0" Column="0" Text="Activity 'ID458' validation failed: Can not find the condition "__Rule_ID458"." />
	<CompilerError Line="0" Column="0" Text="Activity 'ID609' validation failed: Can not find the condition "__Rule_ID609"." />
	<CompilerError Line="0" Column="0" Text="Activity 'ID610' validation failed: Can not find the condition "__Rule_ID610"." />
</Error>
at Microsoft.SharePoint.Workflow.SPNoCodeXomlCompiler.LoadXomlAssembly(String assmNameIn, SPWeb web)
at Microsoft.SharePoint.Workflow.SPWinOeHostServices.CreateInstance(Guid trackingId, SPWorkflow workflow)
at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)
at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow originalWorkflow, SPWorkflow workflow, Collection`1 events, SPRunWorkflowOptions runOptions)

Googling the error that was displayed to the end user revealed nothing, but the underlying exception led me to the UK SharePoint User Group.

The advice from there:

  1. Open your site in SharePoint Designer
  2. Expand the ‘Workflows’ folder, and the folder containing the workflow you want to fix
  3. Right-click on the file that ends in ‘xoml.wfconfig.xml’
  4. Choose ‘Open With’ -> ‘SharePoint Designer (Open as XML)’
  5. Look for the ‘RulesVersion’ attribute
  6. Change its value to ‘V1.0′
  7. Save the xml file
  8. Close the site

Well I gave that a go, saved the template and re-deployed it as the provisioning template… and whaddya know… it worked!

Another note from that post: If you modify the workflow again, you’ll have to change the ‘RulesVersion’ attribute again before saving as an STP as changing the workflow increments this attribute value which has to be reset to ‘V1.0′.

It seems that unless the version is 1.0 on a new site, the workflow breaks. That simple. So in the template you must make sure that the version always remains 1.0.

2 Comments, Comment or Ping

  1. I am having a similar problem though, not similar enough for direct help but I am looking for insight on it. I have a lot of custom workflows running on a site (16 spread accross about 5 lists) they are complex and include updating and creating new list items on other lists. Although the lists update abck and forth some complex conditions make sure they are not infinatly cyclical. The problem is about 3 times a day the availibble memory on our App Server tanks to about 100MB, at this point all workflows on the server (not just the site) begin to error out. To cure the symptom an IIS reset frees the cache but this is just slapping a bandaid on the problem we need to stop the memory leak. here’s the really wierd part, occationally after the IIS reset the workflows on the site I described above stop working even with over a gig and a half of availible memory… and then when I perform an IIS reset it fixes the problem.

    So because you had an issue with one complex workflow and I am having a problem with lots of kind of complex workflows I was wondering if you had any advice or insights into my problem?

  2. I’m afraid I don’t know… but it sounds like a perfect question to ask on Stack Overflow:
    http://stackoverflow.com/

Reply to “Workflow in SharePoint Project Server templates”