How can I get roles and members of a container team in Windchill

Answered

How can I get roles and members of a container team in Windchill

Add Comment
1 Answer(s)
Best answer
public static ArrayList<WTPrincipalReference> getParticipantsForRole(String role, wt.inf.team.ContainerTeam containerTeam) {
ArrayList<WTPrincipalReference> principalObj = new ArrayList<WTPrincipalReference>();
try {
Role rolePM = wt.project.Role.toRole(role);
ArrayList principalRef = containerTeam.getAllPrincipalsForTarget(rolePM);
if (!principalRef.isEmpty()) {
Iterator roleArrIterator = principalRef.iterator();
while (roleArrIterator.hasNext()) {
wt.org.WTPrincipalReference wtPrincipalRef = (wt.org.WTPrincipalReference) roleArrIterator.next();
principalObj.add(wtPrincipalRef);
}
}
} catch (Exception ex) {
log.debug("Error while executing the getParticipantForRole() : " + ex.toString());
}
return principalObj;
}

 

Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.