Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Issue starting workflow programatically

$
0
0

All,

I am attempting to start a SharePoint workflow associated to a content type. I can successfully start the workflow, but it stays as "starting"  for 5 minutes, then the status changes to canceled. This workflow can be started manually, when an item is created, or changed. All 3 of these cases work properly. What could the issue be?

Here's a snippet of my code where I am launching the WF -

foreach (SPWorkflowAssociation workflowAssociation in listItem.ContentType.WorkflowAssociations)
{
  if (workflowAssociation.Name.Equals("workflow name", StringComparison.CurrentCultureIgnoreCase))
  { 
    workflowAssociation.AllowAsyncManualStart = true;
    web.Site.WorkflowManager.StartWorkflow(listItem, workflowAssociation, workflowAssociation.AssociationData);
  }
}

Thanks


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>