Retrieve user email for given user id in bpmn process
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2014 10:29 PM
Activiti version: Activiti-5.15
Tomcat: 7.0.42
Hi all,
I need to retrieve user email in 'Email Task' in bpmn process to forward email to given user id entered in initial form.
I wonder what is best practice to do in bpmn file and how to do it?
We are evaluating Activiti as process engine for our coming project.
I am able to run bpmn process (designed using Activiti designer) with hard coded user id and emails.
Now next steps to get user email for given user id in 'Email Task' to set 'To' field in Main Config.
I will appreciate any hint or link solving above problem.
Tomcat: 7.0.42
Hi all,
I need to retrieve user email in 'Email Task' in bpmn process to forward email to given user id entered in initial form.
I wonder what is best practice to do in bpmn file and how to do it?
We are evaluating Activiti as process engine for our coming project.
I am able to run bpmn process (designed using Activiti designer) with hard coded user id and emails.
Now next steps to get user email for given user id in 'Email Task' to set 'To' field in Main Config.
I will appreciate any hint or link solving above problem.
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2014 10:38 PM
I come across advise to use the identity service from a service task to retrieve details about a specific user, including the email address. Now question is how to get identityService variable. Is it available by default in service task. If not then how to get identityService variable? and where to put whole code?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2014 11:08 AM
Yes you can retrieve the EngineServices on the DelegateExecution and from there retrieve the Identity service.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2018 10:17 AM
Hi guys,
I am also trying to get the username of a user. I am using the identityservice in a scripttask, like this:
var idService = processEngine.getIdentityService();var keys = idService.getUserInfoKeys(person);
However, the 'var keys' is empty. The 'person' variable should be the userId.
I got this userId like this:
var person = execution.getVariable('personField');
Where personField is a formField where I can select a single person. The userId is something like '2002' in my case. Is this correct, or do I maybe have a formFieldId or something?
Best regards,
Martijn
