What is the proper method for launching a workflow from within a running workflow?
We are currently using Visual Studio 2010 and the workflow is running is Sharepoint 2010. Previously this workflow functioned in Sharepoint 2007 without issue. After migrating the package to 2010, the state workflow runs normally but does not properly launch the sequential workflow. If the sequential is launched manually, it will run normally.
Here is the code we are using to call the sequential from within the state.
// 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;
}
}