Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
I have a document with a running process, the document is initiated in a Library, as part of the process, and it needs to be moved to a Product. Doing so, the pending task is throwing an error when the complete task button is clicked; the error is due to loss of permissions, even though the assignee of the task is in the Product Manager role. The complete task worked when i added the user to the ORG ADMIN group. So I would like to add all users of a certain group to the ORG ADMIN group prior to initiating the task, and remove upon completion of the task. Here’s what I have put together, even though the code passes syntax check, the EXP robot is causing an error:
wt.org.WTOrganization wtorg = wt.org.WTOrganization.newWTOrganization("Midway Products");
wt.org.DirectoryContextProvider directoryContextProvider = (wt.org.DirectoryContextProvider) wtorg;
java.util.Enumeration corpGroup = wt.org.OrganizationServicesHelper.manager.findLikeGroups("Corp Managers of MFG Eng", directoryContextProvider);
java.util.Enumeration adminGroup = wt.org.OrganizationServicesHelper.manager.findLikeGroups("ORG ADMIN", directoryContextProvider);
while (corpGroup.hasMoreElements()) {wt.org.WTGroup wtgroup1 = (wt.org.WTGroup)adminGroup.nextElement();
java.util.Enumeration usersEnum =wtgroup1.members();
while(usersEnum.hasMoreElements())
{
wt.org.WTUser user = (wt.org.WTUser)usersEnum.nextElement();
wtgroup1.addMember(user);
}
}