[英]Windows Workflow Foundation Pause By Id
Is it possible to Pause a running workflow if the only information I have is the Id of the process? 如果我仅有的信息是流程ID,是否可以暂停正在运行的工作流程?
workflowApp.Run();
var workflowId = workflowApp.Id;
My requirement is that I have a web app where multiple users can start and pause processes, and the id of the processes will be stored in a database. 我的要求是我有一个Web应用程序,多个用户可以在其中启动和暂停进程,并且这些进程的ID将存储在数据库中。
As far as I can tell I need a reference to the System.Activities.WorkflowApplication
to pause the application as follows: 据我所知,我需要引用
System.Activities.WorkflowApplication
来暂停应用程序,如下所示:
workflowApp.Unload();
How can I call Unload()
to pause a running process if all I have is the Id of the running process? 如果我只有正在运行的进程的ID,如何调用
Unload()
来暂停正在运行的进程?
I've noticed that an entry for a process is only added to the [System.Activities.DurableInstancing].[InstancesTable]
when calling the Unload() method. 我注意到,调用Unload()方法时,仅将一个进程的条目添加到
[System.Activities.DurableInstancing].[InstancesTable]
。
If you use a WorkflowApplication to run a workflow you are responsible for managing it. 如果您使用WorkflowApplication运行工作流,则您有责任对其进行管理。 You can use the WorkflowServiceHost if you want to delegate that responsibility and use the Workflow Control Endpoint to unload or suspend a workflow instance by id.
如果要委派该职责并使用工作流控制端点按ID卸载或挂起工作流实例,则可以使用WorkflowServiceHost。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.