How to return WorkflowInstanceId on CanCreateInstance on Receive Activity called via WCF

StackOverflow https://stackoverflow.com/questions/8126634

سؤال

I am using Windows Workflow Foundation 4.0.

I have got a console app running a WorkflowServiceHost with an EndPoint defined for a Receive Activity at beginning of a workflow.

I can call this endpoint in my client app, and pass in some parameters, but I can't see a way of returning the WorkflowInstanceId to my client app.

هل كانت مفيدة؟

المحلول

The WorkflowInstanceId isn't exposed to the SendReply, or any other standard, activity by default. You need to create a custom CodeActivity and return the InstanceId from the context object passed in. Next you can store the ID returned in a workflow variable and return that from the SendReply.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top