Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
In the workflow I created, I need to assign a separate task for each section. I can do this by creating activities for each section. How can I use it in a single activity by assigning it to the role?
Solved! Go to Solution.
thanks @avillanueva I wrote a code about it
wt.org.DirectoryContextProvider contextProvider =
wt.inf.container.WTContainerHelper.service.getExchangeContainer().getContextProvider()
;
wt.org.WTGroup wgroup = wt.org.OrganizationServicesHelper.manager.getGroup(WTGName,
contextProvider);
wt.query.QuerySpec qs = new wt.query.QuerySpec(wt.org.WTGroup.class);
wt.query.SearchCondition sc = new wt.query.SearchCondition(wt.org.WTGroup.class,
wt.org.WTGroup.NAME, wt.query.SearchCondition.EQUAL, WTGName);
qs.appendWhere(sc, new int[] { 0 });
for(wt.fc.QueryResult queryResult = wt.fc.PersistenceHelper.manager.find(qs);
queryResult != null && queryResult.hasMoreElements();)
roleA=null;
wt.team.TeamHelper.service.deleteRolePrincipalMap(wt.project.Role.toRole("SUBMITTER"),
wtprincial , team );
wt.change2.ChangeIssue ci =( wt.change2.ChangeIssue)primaryBusinessObject;
wt.doc.WTDocument ci =( wt.doc.WTDocument)primaryBusinessObject;
team = wt.team.TeamHelper.service.getTeam(ci);
roleA = wt.project.Role.toRole("SUBMITTER");
team.addPrincipal(roleA, wgroup );
WTGName string is a value I assign group name to it
I believe I have done something similar to what you are asking. I used role variables in the activity. By programmatically populating the role variable with a role, it pulled members from the PBO team at time of execution. So my activity has 20 role variable which stands in for 20 possible signoffs that could occur. Before the task is started, I populate the variables with a list of roles. I do not need to use all 20 but when the task is issued, say one of the roles is Mechanical Engineering. It sends the signoff to members of the ME role against the change object team which is the primary business object. Would this approach work?
thanks @avillanueva I wrote a code about it
wt.org.DirectoryContextProvider contextProvider =
wt.inf.container.WTContainerHelper.service.getExchangeContainer().getContextProvider()
;
wt.org.WTGroup wgroup = wt.org.OrganizationServicesHelper.manager.getGroup(WTGName,
contextProvider);
wt.query.QuerySpec qs = new wt.query.QuerySpec(wt.org.WTGroup.class);
wt.query.SearchCondition sc = new wt.query.SearchCondition(wt.org.WTGroup.class,
wt.org.WTGroup.NAME, wt.query.SearchCondition.EQUAL, WTGName);
qs.appendWhere(sc, new int[] { 0 });
for(wt.fc.QueryResult queryResult = wt.fc.PersistenceHelper.manager.find(qs);
queryResult != null && queryResult.hasMoreElements();)
roleA=null;
wt.team.TeamHelper.service.deleteRolePrincipalMap(wt.project.Role.toRole("SUBMITTER"),
wtprincial , team );
wt.change2.ChangeIssue ci =( wt.change2.ChangeIssue)primaryBusinessObject;
wt.doc.WTDocument ci =( wt.doc.WTDocument)primaryBusinessObject;
team = wt.team.TeamHelper.service.getTeam(ci);
roleA = wt.project.Role.toRole("SUBMITTER");
team.addPrincipal(roleA, wgroup );
WTGName string is a value I assign group name to it