Please, Help!
Its simple, how do I get the service objects right after a workflow is coming back from being persisted?
mardo
Its simple, how do I get the service objects right after a workflow is coming back from being persisted?
mardo
Have you tried the WorkflowLoaded event?Add the following where you create the workflow runtime:
workflowRuntime.WorkflowLoaded += new EventHandler<WorkflowEventArgs>(workflowRuntime_WorkflowLoaded);
Below is an example of how to get the Sql persistence service in the handler:
static void workflowRuntime_WorkflowLoaded(object sender, WorkflowEventArgs e)
{
WorkflowRuntime workflowRuntime = e.WorkflowInstance.WorkflowRuntime;
SqlWorkflowPersistenceService sqlPersistence = workflowRuntime.GetService<SqlWorkflowPersistenceService>();
}
If you need the service within your activity, override the OnActivityExecutionContextLoad method which gets passed an IServiceProvider interface that you can query for services.
Matt
Yes, this is new in Beta 2.2 which is file version 3.0.3807.7. You'll want to upgrade for this and other improvements. Beta 2.2 is part of the May release of WinFx Runtime Components, otherwise known as Beta 2 of the Runtime components along with Beta 2 of Vista, etc. Check here [1] for the latest bits.
Matt
[1] http://msdn.microsoft.com/windowsvista/downloads/products/getthebeta/
This is not good! I have built a whole workflow on the Beta 2 and I need the runtime of beta 2! Is there a possiblity to get the runtime from another download link, because otherwise I would have to get the SDK's and the Visual Studio Extensions for Beta2.2 too and I would have to rebuilt the whole workflow!
Please help!
Peter
You won't have to rebuild the whole workflow.
the biggest thing you'll likely have to change is to make your fields and properties that are bound to into public. Other than that there were some name changes, but it shouldn't take long to update.
I've updated a lot of workflows from the feb build to the may build with very little problem.
Matt