RunWorkflow being called on get_UserData()

Topics: Web Client Software Factory
Mar 16, 2007 at 12:06 PM
I was walking through the call stack using the reference implementation provided with the WCSF, and I noticed that when you call the method EFTPageFlow.UserData"key" you ultimately end up inside a method in WorkflowFoundationPageFlowState which calls scheduler.RunWorkflow(_instance.InstanceId);

Does this mean that everytime you use Userdata there is the "hit" starting up a new instance of workflow on the current thread, or is the RunWorkflow method in the ManualWorkflowSchedulerService class smarter than that.


Developer
Mar 29, 2007 at 5:11 PM
Edited Mar 29, 2007 at 5:11 PM
Hi, SilverStirling

The RunWorkflow method does not start new instance of the workflow, it executes the existing instance whose GUID is the one you pass as a parameter.

Basically when using the ManualWorkflowSchedulerService you have to call the RunWorkflow method to make it do some work. For example, if you raise events to a workflow, you need to call the RunWorkflow after you raise the events to get the workflow up and have it handle the events.

The manual scheduling service is used to execute workflows synchronously.
Take a look at this article for more information about the ManualWorkflowSchedulerService: http://msdn2.microsoft.com/en-us/library/aa349374.aspx

Let me know if this helps,
Ezequiel Jadib
http://staff.southworks.net/blogs/ejadib