AnsweredAssumed Answered

Process instance initiator in REST

Question asked by msvelev on Jun 26, 2014
Latest reply on Jul 7, 2014 by jbarrez
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"
}

Outcomes