I have a requirement wherein if some conditions are not satisfied i need to send the current process instance id to a java method(using java activity) which maintains all such process instance ids and waits for an event to occur .As and when that event occurs i want the execution to restart for all such waiting process instance id.
I understand that I can set the variable as following
ProcessInstance processInstance = executionService.startProcessInstanceByKey("instancename",variables);
executionService.setVariable(processInstance.getId(), "xxx", processInstance.getId());
but i need to set the "xxx" variable before i start the process instance(but at that time no pid is available ,as process is yet to start)
Is there any way that i can get the current process instance id in the jpdl.xml itself during runtime?