Skip to main content
8-Gravel
September 3, 2010
Question

Discussion Subscription

  • September 3, 2010
  • 1 reply
  • 637 views

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);

}
}


1 reply

1-Visitor
September 3, 2010
Your principal is a wtgroup at that point. All teams represent each role in a team as a implicit wtgroup.


Sent from my Verizon Wireless BlackBerry