実行中のワークフロー内からワークフローを起動する適切な方法は何ですか?
現在、Visual Studio 2010 を使用しており、ワークフローは SharePoint 2010 で実行されています。以前は、このワークフローは SharePoint 2007 で問題なく機能していました。パッケージを 2010 に移行した後、状態ワークフローは正常に実行されますが、シーケンシャル ワークフローが適切に起動されません。シーケンシャルを手動で起動すると、正常に実行されます。
これは、状態内からシーケンシャルを呼び出すために使用しているコードです。
// 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, "", true);
break;
}
}