I know this might be a common problem and I by no means take credit for
the idea. As far as I know, it's not possible to have a user task were
the role participants can be altered in the workflow prior to the task
being started without losing the role the end user was acting as. Let me
illustrate. I can create a workflow that has 5 roles required to make a
choice and set it to Any, meaning any one in that role can complete the
task for that role. If I have 2 Quality Engineers in that role, first on
wins. The task does not complete until all roles have made a choice. The
decision for which roles get a choice is made in the workflow template.
Each time the workflow runs, the role list is static. If I want to vary
the list or roles by Product, I need a copy of that workflow for each
product.
Another option would be a massive workflow with each possible role
defined as having its own task. There would be decision gates
determining if the task should be started and logic after the parallel
tasks waiting for each to complete before moving on. It would look
something like an inverse March Madness bracket or branching capillaries
for those medical types.
One workflow but very complex to design and manage.
Another option would be the use of a team or team template as the
participant to the task. You could programmatically add roles to the
team as you see fit before the task was started. I believe from testing
that what ends up happening is that all roles are merged along with the
users in those roles to a single assignee role (how it would show up in
the assignment). Depending on the participant setting (all or any),
would determine if all people needed to complete the task. What you lose
at the end is what role they were acting as when they completed the
task.
I believe there is a need for a better user task that can be send to
various roles determined during the workflow and preserves who each
person's role was during their assignment. For example, I could define
a workflow variable for a team, assign it to this task with 'any' as the
completion option meaning any from the roles in the team. Now, ahead of
this task, I could replace the team, modify it, whatever. When the task
executes, it looks at the team, grabs the roles and issues assignments
to the users of the those roles and maintains who they are. When they
sign, it would say signed by this user as that role. I would prefer
this over other solutions that required a manual task (such as
determining the assignment list) each time the workflow executes.
Anyone up for a collaboration effort to develop a new task type? Is this
coming down the road?