I am trying out Workflow 4.0 and hoping to write a custom activity to start an external executable, wait for that process to complete and then resume subsequent steps in the workflow.
I found the following example that shows (towards the bottom of the page) how to write an activity to waiting for a file to arrive in a specific directory:
Creating Custom Activities with Workflow 4.0
I have a couple of problems with the example. Firstly, when I add the following code:
void FileCreated(object sender, FileSystemEventArgs e)
{
instance.ResumeBookmark(bookmarkName, e.FullPath);
fsw.Dispose();
}
instance.Resumebookmark(...)
does not seem to be available but instance.BeginResumeBookmark
and instance.EndResumeBookmark
are.
I am also unsure of how to change this around to deal with external processes, rather than just watching the contents of a directory.
Is this even the best approach for this kind of thing?