问题
I have subscribed WorkflowFinishActivityEvent with TransactionCommitted phase. I am getting the details of the current finished activity like below
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()
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