Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Fellow Users, I am trying to get an automated subscription to a discussion topic. I have the code below, but it will not resolve a user name for the given Role. When it gets to the while portion of the code, it doesn't go any further and I don't see any error messages. This robot completes and workflow continues to the next step. Any suggestions?
//GET THE ROLE
wt.project.Role subscribeRole = wt.project.Role.toRole("Designer");
//GET THE TEAM
wt.team.Team team = (wt.team.Team)((wt.team.TeamManaged)(self.getObject())).getTeamId().getObject();
//GET THE FORUM
wt.workflow.forum.DiscussionForum forum = com.ptc.netmarkets.forumPosting.NmPostingCommands.getForumFromOid(primaryBusinessObject);
//GET PARTICIPANTS FOR THE ROLE
java.util.Enumeration participants = team.getPrincipalTarget(subscribeRole);
Vector vusers = new Vector();
while (participants.hasMoreElements())
{
wt.org.WTPrincipal wtPrincipal = ((wt.org.WTPrincipalReference)participants.nextElement()).getPrincipal();
if (wtPrincipal instanceof wt.org.WTUser)
{
wt.org.WTUser wtUser = (wt.org.WTUser) wtPrincipal;
vusers.add(wtUser);
}
}