How to programmatically terminate a workflow instance running as a workflow service

天涯浪子 提交于 2019-12-13 08:44:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!