问题
I am using windows workflow service and would like to programmatically terminate a specific workflow instance via a web service request without building this into the workflow itself.
By building it into the workflow itself, I mean having a specific Receive activity which will be responsible for terminating the activity.
So I am imagining something like:
http://myhost/myworkflowservice/myworkflow.xamlx/terminate
Does this type of functionality exist?
Thanks, Eric
回答1:
Just add a Workflow Control Endpoint which allows one to call remote operations on workflow service. Add it through web.config:
<endpoint address="<endpoint_address>" binding="basicHttpBinding" kind="workflowControlEndpoint" />
Then you can use WorkflowControlClient to call control messages (Run, Cancel, Suspend, etc.) to a WorkflowControlEndpoint.
来源:https://stackoverflow.com/questions/18966085/how-to-programmatically-terminate-a-workflow-instance-running-as-a-workflow-serv