We know that local communication services allow workflows to exchange data with their host process. In Chapter 3, we defined a service that raised a BugAdded
event to a running workflow, which in turn invoked an AssignBug
method on the service. The service sent data to the workflow via the event, and the workflow sent data to the service by invoking a method.
The screenshot above shows how the workflow runtime acts as a broker between the local communication service and a workflow instance. The runtime intercepts events from the local service and directs the events to the proper workflow instance. This interception is necessary because the workflow instance waiting for the event might have been unloaded from memory and persisted to a database table. The runtime can ask the persistence service to reload the workflow before it delivers an event, but it needs a workflow instance ID first. Even if the workflow is still in memory, the runtime will need an instance...