Currently have a simple workflow exposed as a service endpoint. The service correlates on the workflow instance id and everything works as expected (2 service calls available ReceiveBegin, Execute).
My problem is that I would like the user to be able to cancel the long running part of the workflow by calling another Receive on the workflow. Have had a look at the WorkflowApplication.Cancel
but as I am running this as a WCF service it doesn't seem to be available.
Documentation seems a bit light on this area and most HOL and examples focus on console apps hosting the workflow.
With workflow services the Workflow Control Endpoint and WorkflowControlClient will allow you to cancel workflow instances.
Another option is shown in the WF4 Batch Job example
来源:https://stackoverflow.com/questions/5456761/wf-4-wcf-cancel-running-workflow