cancel
Showing results for 
Search instead for 
Did you mean: 

Process instance initiator in REST

msvelev
Champ in-the-making
Champ in-the-making
Hello everyone!
I have a case where I want to send an email, to the person who started the process, if the process failes. The process is started through the REST api. This is the how I'm trying to get the initiator's email:


String processInstanceId = execution.getProcessInstanceId();

      String userId = (String) execution.getEngineServices()
            .getRuntimeService()
            .getVariable("initiatingUser", processInstanceId);

      String userEmail = execution.getEngineServices().getIdentityService()
            .getUserInfo(userId, "email");


But I get null on the userId and then as expected on the userEmail. This is my start event in my process definition:

<startEvent id="startevent1" name="Start" activiti:initiator="initiatingUser"></startEvent>


I start the process as follows:

http://localhost:8352/activiti-experiments/runtime/process-instances
{
  "processDefinitionKey":"mailTest"
}
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
Did you check your database, whether the user is stored in the variables table?