How to get the Next Activity Details from the FinishActivityEvent Hanlder?

二次信任 提交于 2019-12-13 14:22:16

问题


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

  1. Performer of the current finished activity

    foreach(var performer in currentactivity.Performers)

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

  2. Finish Message of the current finished activity

    string finishmessage = currentactivity.FinishMessage.Tostring()

My Question:

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

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


回答1:


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.

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

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.




回答2:


You have next assignee on FinishActivityEventArgs.ActivityFinish.NextAssignee. As for next activity - there's no way to know it for the moment. Consider subscribing to activity instance save event args. This way you will catch what activity was created and who is the assignee.



来源:https://stackoverflow.com/questions/12274816/how-to-get-the-next-activity-details-from-the-finishactivityevent-hanlder

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