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

Alex Trainee Asked on May 15, 2015 in Windchill PDMLink.
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;
}
guru@windchillguru.com Guru Answered on May 15, 2015.
Add Comment

Your Answer

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