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

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

Workflow - Skipping Tasks that have no assigned participants

sdrzewiczewski
7-Bedrock

Workflow - Skipping Tasks that have no assigned participants

  • I have a workflow where there arefive parallel approvals assigned activities. Four of the assigned activities have a required participant so that those assigned activities will always be completed. The Fifth assigned activity may have a participant defined for that role. If they do not I want to skip assigned activity.

The five assigned activities get routed to an Andconnector that waits for all 5 if the vote from the assigned activities was Approve. If the vote was Rework, they go to an Or connector and go into a rework loop.

The challenge is, if the fifth assigned activity doesn't have a participant i want to specify that the Link to the And connector for that assigned activity gets fired. I'm struggling with what the correct Event would be? I have the following options available:

  • Start
  • Disable (tried setting this to fire but didn't work)
  • Enable
  • Suspend
  • Resume
  • Skip (tried setting this to fire but didn't work)
  • Terminate
  • Abort
  • Reset
  • Approve = Fire (if a vote is registered then it fires, that's the easy case)
  • Rework

Any suggestions would be greatly appreciated.

7 REPLIES 7

This should do what you are looking for - check out the attachment for some
code that routes based upon whether or not the roleholder is null or not

On Tue, Nov 24, 2009 at 11:22 AM, Stephen Drzewiczewski <
-> wrote:

>
> - I have a workflow where there are five parallel approvals assigned
> activities. Four of the assigned activities have a required participant so
> that those assigned activities will always be completed. The Fifth assigned
> activity may have a participant defined for that role. If they do not I want
> to skip assigned activity.
>
> The five assigned activities get routed to an And connector that waits for
> all 5 if the vote from the assigned activities was Approve. If the vote was
> Rework, they go to an Or connector and go into a rework loop.
>
> The challenge is, if the fifth assigned activity doesn't have a participant
> i want to specify that the Link to the And connector for that assigned
> activity gets fired. I'm struggling with what the correct Event would be? I
> have the following options available:
>
> - Start
> - Disable (tried setting this to fire but didn't work)
> - Enable
> - Suspend
> - Resume
> - Skip (tried setting this to fire but didn't work)
> - Terminate
> - Abort
> - Reset
> - Approve = Fire (if a vote is registered then it fires, that's the
> easy case)
> - Rework
>
> Any suggestions would be greatly appreciated.
>
>

Thanks. I was hoping to avoid putting the conditional in front, but if
that's the only way, so be it.



One question on your code. What is the point of "receiver"? It looks
like it's not really used. Could that be omitted?



Thanks,

Steve D.



Hi Jeff,


This looks almost exactly like what I am looking for, except thatI can't seem to get it to work. I have tried numerous variations on the code you provided, along with other similar examples I have found here in the forum, all to no avail.


My question is, "Do I need to initialize or refresh the team data somehow"? I can't seem to get my expression to recognize that the role really has anyone assigned. No matter how I try to frame the logic, it always 'skips' the task.


I know this is kind of an open-ended question, but I'm hoping you or someone else can point me towards the light.



Thanks,


Steve

Steve can you share the code that you putting in the conditional? I was able to get Jeff's example to work.

In fact there is one wt.properties which skips the task if the role is not
assigned. For some cases that property was not meeting the expectations.

Hence we put together the following code to meet a similar requirement.



/**

* Get the Role Participants from a Team Object & for a
particular Role

* Used to Identify the Role Participants for a Team managed
Object

* @param object TeamManaged

* @return boolean

* @throws wt.util.WTException

*/



public static boolean isRoleAssigned(TeamManaged object,
String rolekey) {

try {

return
isRoleAssigned(object, Role.toRole(rolekey));

} catch (Exception e) {

e.printStackTrace();

return false;

}

}



public static boolean isRoleAssigned(TeamManaged object,
Role role) throws Exception {

Team team =
TeamHelper.service.getTeam(object);



Vector roleParticipants = new Vector();

roleParticipants =
getRoleParticipants(team,role);

if (roleParticipants != null &&
roleParticipants.size() > 0) {

return true;

} else {

return false;

}


}



public static Vector getRoleParticipants(Team team, Role
role) throws Exception {

Vector roleParticipants = new Vector();

QueryResult queryresult =
TeamHelper.service.findRolePrincipalMap(role, null, team);

WTPrincipal participant = null;



while(queryresult.hasMoreElements()) {

RolePrincipalMap
roleprincipalmap = (RolePrincipalMap)queryresult.nextElement();

WTPrincipalReference
wtprincipalreference = roleprincipalmap.getPrincipalParticipant();

if(wtprincipalreference !=
null) {

participant
= wtprincipalreference.getPrincipal();


roleParticipants.add(participant);

}

}

return roleParticipants;

}

HTH





Thank you and have a great time.

Best Regards

Swamy Senthil

Principal Solutions Architect, Swasen Inc

swamy.senthil@swasen.com(Email); 909 800 8423(M); 973 324 2729(W); 866
908 6561(F);




Stephen,


Here are some examples of what I have been trying (please see attachment).


Thanks so much for taking a look!



Steve

Hello Steve

in your attached code you are passing the role display name "Variance
Approvers". Try to pass the role key and any one of the versions should work
fine.





Thank you and have a great time.

Best Regards

Swamy Senthil

Principal Solutions Architect, Swasen Inc

swamy.senthil@swasen.com(Email); 909 800 8423(M); 973 324 2729(W); 866
908 6561(F);






Top Tags