Get user email in Activiti Process Services Script Task

cancel
Showing results for 
Search instead for 
Did you mean: 
jvaidya
Active Member II

Get user email in Activiti Process Services Script Task

I'm trying to get user email addresses in an Activiti Groovy Script Task using the user's Activiti ID number. I'm trying to do this: 

User user = identityService.createUserQuery().userId(execution.getVariable('initiator')).singleResult();
execution.setVariable('initiator_human', user.getEmail());

But user is always null. I believe this is because the IDs that Activiti uses, which are numbers, do not match the ID that is expected in this method. 

Any ideas on how to fix this? 

1 Reply
cjose
Senior Member II

Re: Get user email in Activiti Process Services Script Task

You can use UserInfoBean. Please refer User Info Bean (userInfoBean) | Alfresco Documentation for more details.