Correlation in WF 4 on InstanceId Workflow

On Windows Workflow Foundation under .NET 4.0, is there a way to map InstanceId-based operations (GUIDs) to a long, continuous workflow?

For instance:

  • Operation 1 creates an instance of the workflow, returns the identifier of the workflow instance to the client
  • The client may later query the InstanceStore database to retrieve the InstanceId instance from the instances.
  • The client invokes operation 2 and passes the InstanceId for content-based correlation

I can do all this if I have a client creating and passing a GUID for the first operation, use this value in the content correlation, and then increase this value when saving. This seems redundant, however, since the workflow is already creating a GUID for the instance.

+3
source share
1 answer

Create an action to extract the workflow instance ID from the passed context and return it from the SendReply action. Then use the CorrelationInitializer in SendReply to configure query correlation.

+4
source

Source: https://habr.com/ru/post/1775249/