There are two points to make:
- Task Engine does not support assigning task to groups. Only to individual users and roles
- It also does not support accepting a task by a group, only by individual users.
But it seems like what you are really looking for is for a way to discover and display just groups (or roles) which user who accepted a task is a member of.
TaskDisplayProvider.getAcceptedPrincipalsListProvider() returns you list of display names of accepted users, this is not what you need. Instead you need to obtain list of user IDs who accepted a task, from .getTaskInfo().getAcceptedByList() (where is managed bean representing current task)
Having the IDs of the user you now can determine groups and roles user is a member of using common directory service APIs. Details about this API can be found at:
The code you would need is something like this:
IDirectorySession s = DirectorySystemFactory.getDirectorySystem().createSession();