- User name and email for process initiator?
- User name and email of the user who completed the previous task?
- Emails for users on a particular group?
Is there a reason you specifically want a script task? It makes things a bit cumbersome to write and test.
If you’re using the out of the box users and groups, the answers would be:
- The initiator is stored as a variable (defined by flowable:initiator). This is the userId. Use this userId to fetch, via the identityService, the other bits of information.
- If the script task is immediately after the user task, the transaction won’t have been committed yet. You could store the assignee id of the previous task using a TaskListener and put the id in a (transient) variable for example and use same mechanism in (1) to get the info.
- You’d need to do a UserQuery for a particular group and simply loop over the results.
You managed to get these results?
Not using the script. I am in the process of implementing a task listener.