Hi Thong Huynh,
In my use case, I have a user task, Let's call it User Task 1. There's a button called "Re-assign". If you press this button, it takes you to User Task 2. If you don't, the workflow changes, but that's fine. When you do get to User Task 2, you select a new user to re-assign that task. When you press Submit, a Groovy script is called. In that script, the current user is being removed from the role that can execute User Task 1, and the new user is added to that role. But as soon as the script is executed, current user again sees User Task 1 and the new user doesn't.
It seems like a concurrency issue, perhaps? Because when the current user sees User Task 1 again, and presses "Re-assign" again, the current user doesn't see the User Task 2, the new user now sees User Task 2.
Flow problem: New user should have seen User Task 1, and current user shouldn't have seen User Task 1 for the second time.
I hope I got my point across, thank you for your help!