Getting Data into a Windows Workflow Instance

We are currently building a system that abstracts all kinds of technical information about web services from some other systems. It's a bit like Enterprise Bus, but a bit more.

We decided to use Windows Workflow to handle requests. Once we figure out what actions are required, we will begin a workflow specifically designed to handle the action. Now some of the web services that we will call are asynchronous, so the workflow must wait for a response. The basic idea is that we are implementing a web service callback at our end, and when the callback comes in "somehow", it passes the data to the worker process waiting for a response.

So far, I've seen two possibilities:

  • ExternalDataExchangeService
  • WorkflowQueuingService

The first service is relatively easy to use, but event based, so if you miss an event, you miss data. We need a queue based solution as it is technically possible to receive a callback from the web service even before we receive a synchronous response that tells us we will receive a callback soon.

The second service seemed perfect, but it very restricts its use. Getting an item into a queue is easy, but we need to make sure the queue exists before we can do that. And queue creation seems to be possible only in overriding Execute Activity. Since we have many different workflows, we have a base workflow class that does some work in it. Initializes an override and would very much like to make the creation of the queue there, so we won't need to create a special "Initialize" activity that each workflow should start with. We would also like to be notified when a new item is received in the base class. Therefore, the particular worker process only had to wait for WaitHandle to know that there was data in the queue. Finally,we want to be able to read data from the queue from the code activity in a particular worker process (after the WaitHandle message).

Does anyone have an idea, doesn't have to be with the two services I mentioned, but we would like to keep things as simple as possible.

0


source to share


2 answers


It turns out my guess was wrong. I was 100% sure I was testing the script and ran into problems, but after discussing with a colleague, I re-tested it and the ExternalDataExchangeService worked fine. So there is no need to find a more complex solution, now we just go to ExternalDataExchangeService.



0


source


In WF, all communications between the runtime or services and the actual worker processes are queue-based. The appearance of the ExternalDataExchangeService uses events, but it's just a thin layer around the WorkflowQueuingService and WorkflowQueue mechanism.



In general, I prefer to use the WorkflowQueuingService as it gives complete control. Once you understand the basics, it is even easier to work with this ExternalDataExchangeService in most cases.

+1


source







All Articles