如何从 FinishActivityEvent 处理程序中获取下一个活动详细信息? [英] How to get the Next Activity Details from the FinishActivityEvent Hanlder?

查看:23
本文介绍了如何从 FinishActivityEvent 处理程序中获取下一个活动详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在 TransactionCommitted 阶段订阅了 WorkflowFinishActivityEvent.我正在获取当前已完成活动的详细信息,如下所示

I have subscribed WorkflowFinishActivityEvent with TransactionCommitted phase. I am getting the details of the current finished activity like below

  1. 当前完成活动的执行者

  1. Performer of the current finished activity

foreach(var performer in currentactivity.Performers)

{string Performeroftheactivity= performer .title.tostring();
}

当前已完成活动的完成消息

Finish Message of the current finished activity

string finishmessage = currentactivity.FinishMessage.Tostring()

我的问题:

我想从当前已完成的活动事件中获取下一个分配的活动标题和受让人.

I would like to take the Next assigned activity title and assignee from the current finished activity event.

谁能帮我如何得到这些?我在 API 中没有看到任何相关的属性或方法.

Could anyone help me how to get these? I don’t see any relevant Properties or methods in the API.

推荐答案

您可以通过加载当前流程定义、确定当前活动的位置并弄清楚下一步是什么来获取下一个活动.

You can get the next activity by loading the current process definition, determining the position of the current activity, and figuring out what's next.

这或多或少在 Mihai Cadariu 的这篇文章中有所体现.

This is more or less shown in this post by Mihai Cadariu.

编辑 - 删除了关于此不受支持的愚蠢评论.由于您在事件系统中,该代码将起作用.如果您想在工作流自动活动中使用它,则必须使用 CoreService.

EDIT - Removed silly comment about this not being supported. Since you're in an event system, that code will work. If you want to use it in a Workflow automatic activity then you would have to use the CoreService.

这篇关于如何从 FinishActivityEvent 处理程序中获取下一个活动详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆