WF 4.0 WorkflowServiceHost 和实例事件(中止、已完成、空闲等)
当我的工作流作为服务托管时,有没有办法以某种方式订阅工作流实例事件?
我已经创建了工作流服务主机并打开,稍后我的客户端应用程序将调用它,并根据内部工作流代码创建、完成、空闲等新的工作流实例。
但是workflowservicehost只有打开、关闭事件,而不是与内部实例相关的事件。当我使用工作流应用程序类进行托管时,没有问题,因为工作流应用程序已完成、中止、空闲属性。
我将使用此事件进行自定义日志记录,例如更新有关工作流程状态的表。从标准跟踪数据库获取此信息不是一个选项,因为我使用与我的工作流程目的相关的自定义状态代码。
Is there a way to subscribe somehow the workflow instance event when my workflow is hosted as a service?
I have created my workflowservicehost and opened, later my client app will call it and new workflow instance is created, completed, idle etc. according the workflow code inside.
But workflowservicehost only has opened, closed events not something related to the instance inside. When i used workflowapplication class for hosting there was no problem because workflowapplication has completed, aborted, idle properties.
I would use this events for custom logging like updating a table about the status of the workflow. To get this from a standard tracking database is not an option because i use custom status codes related to the purpose of my workflow.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过创建自定义 TrackingParticipant 来跟踪 WorkflowServiceHost 内的各个工作流程。如果需要,您可以添加 TrackingProfile 来过滤您感兴趣的事件,甚至从工作流程中提取变量。
有关入门的详细信息,请参阅此处。
You can track individual workflows inside of a WorkflowServiceHost by creating a custom TrackingParticipant. If needed you can add a TrackingProfile to filter the events you are interested in and even extract variables from your workflow.
See here for more info to get started.