Set Up Participants Tab
Is there a way to FORCE a participant to be selected before a user completes task? Some sort of check that will not allow task competition unit a participant is selected?
Is there a way to FORCE a participant to be selected before a user completes task? Some sort of check that will not allow task competition unit a participant is selected?
Yes, you will need to put code in under the Transitions tab for the transition that will send it on.
Here is sample code. You will need to change it for your specific role in the workflow. It will put up a box telling the user that there is no one in the role.
wt.workflow.work.WfAssignedActivity act = (wt.workflow.work.WfAssignedActivity) self.getObject();
wt.workflow.engine.WfProcess pro = (wt.workflow.engine.WfProcess) act.getParentProcess();
wt.team.Team t = wt.team.TeamHelper.service.getTeam(pro);
java.util.Map members = t.getRolePrincipalMap();
java.util.Set keys = members.keySet();
java.util.Iterator itr = keys.iterator();
while (itr.hasNext()) {
wt.project.Role role = (wt.project.Role) itr.next();
System.out.println("Role-=-=-=" + role);
if (role.toString().equalsIgnoreCase("specify_role_here")) {
java.util.ArrayList users = (java.util.ArrayList) members.get(role);
//If there is no user in specify_role_here role throw exception
if (users.isEmpty()) {
throw new Exception("Select user for " + role.getDisplay());
}
}
}
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.