I am trying to assign one of my tasks to a group (not a role or an individual) based on a variable defined earlier on in the process. For example:
If workflowVar = A, assign group A to the task
if workflowVar = B, assign group B to the task
if workflowVar = C, assign group C to the task
I see that there is functionality in Windchill to assign a task to a variable, but I have not found any documents to tell me how to use that functionality. How could I make that variable the group I need? Is there a way to GET a cluster of groups and make the variable the group that I need for the task?
Perhaps you could create three tasks, the task participant is group A,B or C. Then create a ‘manual exclusive’ condition to route the workflow to the the right task/group depending on your variable.
@rhart Thank you for your reply.
Unfortunately this would not work. I would be creating 15+ more tasks on the workflow. Using the manual exclusive condition to route would also defeat the purpose of automation in this process. I am trying to remove "set up participants" or other tasks as much as possible, so having a way to assign this task automatically is my goal.
Alternatively, adding a group to a role automatically using code would solve my problem as well:
If workflowVar = A, add group A to roleA
if workflowVar = B, add group B to roleA
if workflowVar = C, add group C to roleA
I'd recommend using expression code to add the Group to the role. There is sufficient helpers to get the Principals from the Group and Assign them to the Role for the PBO. (Along the lines of using wt.group or organizationservices to get members and then using the wt.team helper class to add the principals to that role wt.team.TeamHelper.service.addRolePrincipalMap)
Thank you, this gives me a few key words to look for. I'm just trying to come up with the code to do this. First, to GET a group, then to ASSIGN that group to a role.