Let's return to the bug-tracking workflow we used in Chapter 4 to see if a custom activity can help us in building a bug-tracking application. The bug-tracking workflow is needed to request additional documentation for a bug. To request this documentation, the workflow communicates with a local service we built in Chapter 4 that implements the following interface:
[ExternalDataExchange] interface IBugService { bool RequestUpload(Guid id, string userName); event EventHandler<UploadCompletedEventArgs> UploadCompleted; }
A workflow that needs documentation would first use a CallExternalMethod
activity to invoke the RequestUpload
method. Immediately afterwards, the workflow would use a HandleExternalEvent
activity to wait for an UploadCompleted
event. We need to insert and configure both of these activities into every workflow that might request an upload. Our goal is to replace these two activities with a single activity we customize for the job.
To get started, we...