Our generic delegate will push messages onto a pubsub queue with the task name and task variables. The task name is something akin to a method name and the variables are its parameters. The client which reads the message is responsible for running the actual business logic with the given paramaters, and returning the output on another pubsub queue. Our engine is supposed to read this queue, find the write execution based on some meta info in the message and write any variables to the process instance (hopefully only the ones specified as out parameters in the bpmn).
As you can see, since we have to wait for the return call to write out variables, control has to be passed out of the delegate. And we need to get a handle on the delegate again in order to pass execution back to it.