views:

304

answers:

1

I have a workflow that has a public "State" property that returns a custom class storing data about the workflow (it changes during the execution of the workflow).

What is the best pattern/practice to get the value of that property while in the code of the workflow host (ASP.NET app in this case) at any point?

I looked into the CallExternalMethodActivity, but I ruled it out since in my case I need to have some kind of "on demand" model, where I can request my workflow to give me the value of it's property at any point of time of it's execution.

I also looked into tracking services, but since I don't really care about tracking any events, it seems like there is an overhead of the whole tracking model and also duplicity of saving the data to the tracking store while it is already part of the workflow.

Any suggestions/code examples?

+2  A: 

Matt Milner has got a pretty good article with a working sample. He's using a custom tracking service that does the job for you, so you don't need to mess with tracking profiles and the like.

Make sure you also read the article user comments, as they contain some important information about persisted workflows.

kay.herzam