This might help you get started. This code finds the assignees for a workflow activity.
String name[] = new String[100];
for (int j=0; j<name.length; j++){name[j] = null;}
int i = 0;
try
{
wt.workflow.work.WfAssignedActivity wfact = (wt.workflow.work.WfAssignedActivity) self.getObject();
java.util.Enumeration assignments = wfact.getAssignments();
while (assignments.hasMoreElements())
{
wt.workflow.work.WfAssignment assignment = (wt.workflow.work.WfAssignment) assignments.nextElement();
java.util.Enumeration principals = assignment.getPrincipals().elements();
while (principals.hasMoreElements())
{
wt.org.WTPrincipalReference wtpr = (wt.org.WTPrincipalReference) principals.nextElement();
name[i] = wtpr.getDisplayName();
i++;
}
}
}
catch(java.lang.ClassCastException cce)
{
throw new WTException("Only WfAssignment objects can get assigned Principals" + cce);
}
To find the groups that the user belongs to, you can use the wt.org.OrganizationServicesHelper.manager class to find methods for retrieving that info.
Hope this helps.