在创建此问题时,我们找到了解决方案。似乎MOSS 2007并不介意协会数据是否为空。 MOSS 2010不喜欢空数据,并且会在启动工作流程后不久就会失败。解决方案是将空xml标记作为关联数据。
// Starts CAB Implementation Workflow. SPWorkflowManager wfManager = this.workflowProperties.Site.WorkflowManager; SPWorkflowAssociationCollection associationCol = this.workflowProperties.List.WorkflowAssociations; foreach (SPWorkflowAssociation association in associationCol) { // Replace {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} with the Id of the workflow you want to invoke if (association.BaseId.ToString("B").Equals("{af0775b9-8f10-468d-9201-792a4f539c03}")) { wfManager.StartWorkflow(this.workflowProperties.Item, association, "<root />", true); break; } }
现在顺序工作流程从州开始成功,没有任何问题。