Start procces from java delegate with the 'Started by' user information

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

Start procces from java delegate with the 'Started by' user information

Hi,

I have a java delegate that start other process with this code:

RuntimeService runtimeService = execution.getEngineServices().getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKeyAndTenantId("process2",variables,"tenant_1");

but the process started appear without the "Started by" user information and show the message " PROCESS.MESSAGE.NO-STARTER".

I have tried to link the user after starting the process, as starter and also as owner, but without result.

runtimeService.addUserIdentityLink(processInstance.getId(),execution.getVariable("initiator").toString(),IdentityLinkType.STARTER);

Is there any way to launch a process from a java delegate and assign the "started by" user?

 

Regards.