OperationContext in State Machine Workflows (WF 4.5)

149 views Asked by At

So what I'm struggling with is the following scenario.
I'm trying to integrate DI (Autofac) in a xamlx workflow service.
Since such a service is merely a WCF hosted service, I thought I could just look at Autofac's WCF integration implementation and adapt that so it can be used with a WorkflowServiceHost(Factory).
And while I managed to do this (adding an InstanceContextInitializer which puts an IExtension on the current OperationContext to start a new LifetimeScope for the WCF request) and successfully tested it with a simple Sequential Workflow, this doesn't work with a State Machine Workflow!

Well, it does work in the first state of that workflow, but after transitioning to the following state, the OperationContext is gone.
So my questing is, is anybody out there doing something similar? To have a lifetime scope per WCF request to a xamlx state machine workflow service?

For now I guess I'm going to have to go with a lifetime scope per Activity to have some kind of control over my resovled objects from the container..

0

There are 0 answers