Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi All,
I'm creating a Promotion Request Approval process and wanted to know if there is any way to prompt the user to select the participants if no participants have been selected in the list.
I've removed the the default Roles Approver and Reviewer roles in the Participant selection list and the user needs to select the participants manually. If the user forgets to select any participant and clicks on finish or next, is there a way to prompt the user to select atleast one participant from the list.
Any suggestions would be helpful.
Thanks,
Kiran Lakshminarayanan
Here's the one I use in my Problem Report and Change Activity wf's, which someone else provided me.
Add this to the COMPLETE or other transition of the activity.
------------------------------------
boolean provider = false;
wt.workflow.engine.WfProcess wfprocess = (((wt.workflow.work.WfAssignedActivity)self.getObject()).getParentProcess());
java.util.Enumeration roles = wfprocess.getRoles();
while (roles.hasMoreElements())
{
wt.project.Role role = (wt.project.Role)roles.nextElement();
java.util.Enumeration participants = wfprocess.getPrincipals(role);
if (participants.hasMoreElements())
{
if (role.getDisplay().equalsIgnoreCase("Assignee")) provider=true;
}
}
if (!provider)
{
String msg = "No participants were assigned to the Rework Assignee role. " + "\n Assign a participant, then RESELECT the Rework option and click on Complete Task.";
java.lang.Exception exp = new java.lang.Exception(msg);
throw exp;
}
---------------------------------------------------