In .Net 3.0, we were using the ManualWorkflowSchedulerService to manage our own threads for executing the workflows. Some of them needs to be sync, and some other needs to be async, but we need to copy some datas on the current thread in the thread executing the workflow before activities get executed. For exemple, we have some activities with a build-in security check, so if we lose the current user, all our tests will fail.
1) For the sync workflows : In 4.0 Beta 1, It seems that both WorkflowInstance.BeginRun and WorkflowInstance.Run are async. How can I invoke them sync using the WorkflowInstance (I would prefer using this class instead of the WorkflowInvoker to avoid having two way of initialising workflows).
2) For the async workflows : Is there anyway to be called in the executing thread before the first activity executed so we can copy the required datas in the thread?