Chris Dunaway

I am using a state machine workflow.

When I receive an event for one of my EventDrivenActivity classes, from within the Invoked method, how can I get access to my local communication service

The Initialize method has a parameter called IServiceProvider with which I can call the GetService method, but inside an Invoked method or anywhere else in the state activity, I can's seem to get the local communication service. Is this possible

Chris


Re: Windows Workflow Foundation Accessing a local communication service from within an Invoked method

Moustafa Ahmed

Hi Chris,

Did you get the chance to look at the State Machine Communication Sample here: http://msdn2.microsoft.com/en-us/library/aa353566.aspx

Thanks






Re: Windows Workflow Foundation Accessing a local communication service from within an Invoked method

Chris Dunaway

I did see it, but it does not access the communication service from inside an activity in a state from what I can tell.

I was able to do that by deriving my own class from EventDrivenActivity and then using GetService in the OnActivityExecutionContextLoad overloaded method.

Chris