HI,
Is there a way to start a new processInstance in a specific task later in the bpmn? Alongside businessKey and variables if possible. I have the following Java-method:
runtimeService.startProcessInstanceByKey(processDefinitionKey, businessKey, variables)
But I need something like the functionality of the restart-method, which starts in a specific task:
runtimeService.restartProcessInstances(processInstance.getProcessDefinitionId())
.startBeforeActivity("MyTaskId").processInstanceIds(processInstance.getId())
.execute();
But I think this one requires an existing processInstanceId to begin with and is not combinable with businessKey and variables.
I thought of starting a processInstance, then starting an activity in my task and deleting the activity in the start - but I have a couple of service tasks in the beginning that are executed automatically and I fear they might be executed before the delete operation runs.
Thank you for any help!!!