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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Workflow task: select participants

kregimbald
12-Amethyst

Workflow task: select participants

We have a problem with users skipping through the "select participant" task in one of our workflows. In other words, they do not select a participant but they do complete the task. When no particpant is chosen, the workflow proceeds but we are unable to locate the next task. There is no indication in the "routing/history" window.

We have been terminating the workflows and re-starting them in order to resolve the issue.

We want to ensure that the task cannot be completed unless there is at least one participant. Is there a way to set these conditions in a specific task?

Thanks

5 REPLIES 5

possibly something like this (switch out of HTML mode to see correctly). Adjust Role / path for your situation...

CODE On wORKFLOW ACTIVITY COMPLETE TRANSITION (FOR REVIEWER ROLE):

if(!ext.alcon.workflow.WorkflowHelper.verifyRoleForUserOffKey( (wt.lifecycle.LifeCycleManaged) primaryBusinessObject, "REVIEWER")) { throw new wt.util.WTException(new Throwable(new String("No Reviewer assigned!")));}

METHOD IN CUSTOM WORKFLOW HELPER CLASS

/** * Use this method to verify a user is in the team instance based on the key value of the role not the display name.
public static boolean verifyRoleForUserOffKey(LifeCycleManaged pbo, String role){ LOGGER.debug("Entering verifyRoleForUserOffKey method passing in: LCM:"+pbo + " Role: "+role); ArrayList wfusers = new ArrayList(); boolean roleExists = false; boolean rolePopulated = false; Team team = null; try { team = TeamHelper.service.getTeam(pbo); HashMap wfparticipants = TeamHelper.service.findAllParticipantsByRole(team); Object key = null; Role wfroles = null; Iterator wfset = wfparticipants.keySet().iterator(); while(wfset.hasNext()) { key = wfset.next(); wfroles = (Role) key; if(wfroles.equals(Role.toRole(role))) { wfusers = (ArrayList) wfparticipants.get(key); roleExists = true; } } } catch(WTException exp){ exp.printStackTrace(); } if(!roleExists) { LOGGER.warn("The role : "+role+ " does not exists in the team "+team.getName()); } if(wfusers.size()>0){ rolePopulated = true; } else{ rolePopulated = false; } LOGGER.debug("Exiting verifyRoleForUserOffKey method returning: "+rolePopulated); return rolePopulated; }

Wouldn't making the role Required for the task do this?

KD
12-Amethyst
12-Amethyst
(To:kregimbald)

Usually if you didnt select a role the task goes to process initiator or Administrator.

If you make the role required that means the task of that role need to be completed in order to procedd further but it will not enforce the selection of pariticipant for that role.

Best Regards,

Kaushik

kregimbald
12-Amethyst
(To:KD)

I thought so too, that the task would go back to the initiator however this does not seem to be the case. There is no indication as to where the task is in the workflow.

Correct, with your second point. The task is required, but it does not ensure that a participant is chosen.

Some customization required to achieve this. Waiting approval...

Announcements


Top Tags