views:

316

answers:

1

I'm having some conceptual trouble on figuring out how to best implement this... I want to create a custom Activity class for Windows Workflow. The activity has to call out to a third party library method that itself runs another process asynchronously and may take anywhere from seconds to many hours to complete. This library offers the ability for me to either poll for the method result or to subscribe to an event that indicates its completion. In my non-workflow apps, I typically just subscribe to that event, but that doesn't seem to be reasonable in the workflow case. I'm also not sure exactly how to best implement a polling scheme. Can someone recommend some pointers to similar problems?

+1  A: 

Kirk Allen Evans wrote an interesting blog about this with some pretty good code examples.

rjrapson
I'm learning WF still, ... Why doesn't Kirk call ActivityExectionContext.CloseActivity() in the Workflow.Ftp.FtpCallback() directly? Instead, he pushes something onto a queue he creates then has a queue listener call CloseActivity(). This seems like a lot of extra overhead.
Frank Schwieterman