Question

I have a sequential workflow with an OnWorkflowActivated and three Create Tasks which are inside of a Sequence. Currently, after the OnWorkFlowActivated is called and done executing the code, it will call the first of the three Create Tasks. However, once the first task is done executing all the code, it won't call the next two tasks. The only way one task can call the next task is by calling the actual method name, e.g.

uploadToFTPTask_MethodInvoking(sender, e);

I would like the workflow to automatically (without user input) go to the next task as long as all the code in the previous task has completed successfully. And if the code has not completed, have the workflow report that the workflow did not complete. This workflow is inside Visual Studio and not SharePoint designer.

Was it helpful?

Solution

I needed have a unique correlation token for each task as well as populate the task GUID at runtime and associate the ListItemID at runtime. The code inside the task method looks like this:

        UploadToFTPTask_TaskId1 = Guid.NewGuid();
        UploadToFTPTask_ListItemId1 = workflowProperties.ItemId;

With that code, I didn't need to call on the next task with its method name, the workflow automatically went to the next task as long as it had a unique TaskID and a ListItemID.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top