Hello everyone, hope you all had a good Holiday!
I have a question around how to remove a user from a Workflow team of a Promotion workflow.
Basically let’s say there is a Reviewers role for the Promotion workflow. I want to programmatically remove users XYZ every time if they are accidentally added there.
I have an expression that runs after the workflow starts and it does work well BUT...it only removes the user IF the user is directly added to the team. If the user is in the team via a Group, it does not remove the user from the team.
My hope is that someone has an idea of how to handle the group added users as well.
Group - "Design Approvers" contain 3 users 1) ABC 2) PQR 3) XYZ is added to Approver role and you don't want user XYZ in Approver then you can remove entire group from Approver role and add only two users (1. ABC and 2. PQR) from Design approver group.
Hope this helps !!!
Hi Steve ,
It is centric around 2 entities ,
1. Are you using Team Template to define the WF Roles & Memeber . OR
2. Shared Team
In the first case , you may need to capture the WFProcess -> Get Team -> Check for the User assigned to that Role and Remove.
In Second case , you need to capture the user assiged in container level and remove the user.
Something like this ,
Team processTeam = TeamHelper.service.getTeam((TeamManaged) wfProcess.getObject());
(HashMap) processTeam.getRolePrincipalMap(); ( Check User)
wt.team.TeamHelper.service.deleteRolePrincipalMap(ownerRole, thePrincipal, team);
I have similar type requirement, but in my case i am to remove required role from Workflow. could you please guide, how i can achieve this?