问题
With the help of event handler i am getting the id of the user who have finished the Workflow activity.
For getting the Id i am writing like:
foreach(var user in activity.Performers)
userId=user.Title.ToString();
Now, similarly how can i get the members of the group(their id's) to which the user belongs.
回答1:
If you are in the event handler then you are using TOM.NET.
You need to get list of users in the group. Each group has GetGroupMembers
method that you can use.
Here's the code you need:
foreach (var user in activity.Performers)
{
var groupMemberships = ((User)user).GroupMemberships;
var filter = new GroupMembersFilter(session);
foreach (var groupMembership in groupMemberships)
{
var users = groupMembership.Group.GetGroupMembers(filter);
}
}
You can control how much data you get back by setting properties of filter
来源:https://stackoverflow.com/questions/12243526/how-to-get-the-members-of-the-group-in-tridion