Email connector


Can you tell me how to recover initiator's email ?
Thanks in advance


Submitted by rtumminelli_1394599 on Fri, 06/14/2019 - 18:27

By initiator you mean the user who started the process, not the actor right?

1 answer


I'm assuming you mean the user who started the process.

Lets say you wanted the email to be sent from the person who started the process. Step through the connector wizard until you get to the point where you can set the From Address. Now click the edit expression button (little pencil icon) next to the "From" field. Change the expression type to a script. This will allow you to use Bonita API. To get the email of the person who started this process, you could do something like:

Long startedById = apiAccessor.getProcessAPI().getProcessInstance(processInstanceId).getStartedBy();
String emailAddress = apiAccessor.getIdentityAPI().getUserContactData(startedById, true).getEmail();
return emailAddress;