cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Promotion Request Participant Selection Prompt

klakshminarayan
4-Participant

Promotion Request Participant Selection Prompt

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



2 REPLIES 2

On 07/31/13 09:27, Kiran Lakshminarayanan wrote:
>
> 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.
>

I do something similar for a variance workflow in which I am checking to make sure the user selected
one and only one participant. This is done in a conditional that comes after the "approver
selection" task. The workflow is setup to that if the incorrect number of approvers are selected
then it sends the user an email and then loops them back to the "approver selection" task.

The code that does the checking is this:

//This expression will check to make sure one and only one participant has been selected.
String sig = "Conditional to find number of approvers selected";
System.out.println("Here at " + sig);
result = "Send To Engineering";

//get the principals selected for the VARIANCE APPROVERS role
java.util.Enumeration
principals=((wt.team.Team)((wt.workflow.engine.WfProcess)self.getObject()).getTeamId().getObject()).getPrincipalTarget(wt.project.Role.toRole("VARIANCE
APPROVERS"));

//find out how many principals have been selected
int i = 0;
while(principals.hasMoreElements())
{
System.out.println(sig + " here at principals loop");
wt.org.WTPrincipal wtprincipal =
((wt.org.WTPrincipalReference)principals.nextElement()).getPrincipal();
System.out.println(sig + " principal = " + wtprincipal.getPrincipalDisplayIdentifier());
i++;
}
System.out.println(sig + " num selected = " + i);
if(i != 1) result = "Rework Approvers";

> Thanks,
>
> Kiran Lakshminarayanan
>
>
> -----End Original Message-----


--
------------------------------------------------------------------------
Randy Jones
Systems Administrator
Great Plains Mfg., Inc.
1525 E North St
PO Box 5060
Salina, KS USA 67401
email: -
Phone: 785-823-3276
Fax: 785-667-2695
------------------------------------------------------------------------

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;


}


---------------------------------------------------

Top Tags