Start the SharePoint 2010 Workflow Asyncronous
-
Monday, April 16, 2012 11:33 AM
I want to start workflow from one of Class file, not related to Workflow file.
If I start workflow with runoption.Syncronous, it will start immediately without error and completing its job. The status on the workflow page also shows Completed.
But, If I start the workflow with runoption.Asyncronous, the status on the worklfow page remains as "Starting" forever. Nothing happening, it doesn't provide any error.
Below code I have used to start the workflow. It's Site Workflow.
site.WorkflowManager.StartWorkflow((
object)null, WorkFlowAssociation, eventData, SPWorkflowRunOptions.Asynchronous);Thanks.----------------------------------------------------------- Hardik Shah
- Moved by Jack-GaoMicrosoft Contingent Staff, Moderator Tuesday, April 17, 2012 1:10 AM It is SharePoint2010 (From:SharePoint - General Question and Answers and Discussion (pre-SharePoint 2010))
- Changed Type Hardik.S.Shah Tuesday, April 24, 2012 6:30 PM
All Replies
-
Tuesday, April 17, 2012 8:01 AMModerator
according to http://msdn.microsoft.com/en-us/library/gg749857.aspx, the Asynchronous option queues the workflow to be started by the workflow timer job at the next timer interval.
it may be time consuming for me to reproduce the "starting" status you describe, but i would suggest you to check:
If SharePoint timer job is started in services.msc;
If the Microsoft SharePoint Foundation Workflow Timer Service is started (Central Administration->services on server) on the server where the SharePoint timer job is started;
The workflow throttle as described in http://msdn.microsoft.com/en-us/library/dd441390(v=office.12).aspx
You may also need the ULS Log Viewer to find error if there is any on SharePoint servers on which the workflow is run.
Someone documented a very elusive case here http://ybbest.wordpress.com/2012/02/07/how-to-fix-workflow-failed-to-start-in-sharepoint2010/ , but he get failed to start instead of starting.
- Edited by GuYumingMicrosoft Contingent Staff, Moderator Tuesday, April 17, 2012 8:02 AM
-
Friday, April 20, 2012 6:54 AM
Hi GuYuming,
The SharePoint Timer Job is started in services.msc,
Also, Workflow TImer Services is also running.
When I went to Monitoring portion on Central Admin, and checked for the "Bulk Workflow Task Processing" the period was set to daily basis. I have modified it to 1 min.
After that, the workflow status changed from "Starting" to "InProgess". That is good thing. I also debuged the code.
It is went to its defualt constructor to initialize component.
public sealed partial class RetentionWorkflow : SequentialWorkflowActivity
{
public RetentionWorkflow()
{
InitializeComponent();
} but after that It is not able to go to next code activity and staying on the "In Progress" state only. Nothing happen.
----------------------------------------------------------- Hardik Shah

