Hi,I have a workflow which contains a subprocess (embedded). This subprocess contains a receiveTask.I am writing a junit test in which I want to signal that receiveTask.In my process I have set the businessKey when creating the process and I also have a process variable which contains that business key.I cannot find a way to get the correct execution id to assure that the signal succeeds.My first try wasruntimeService.createExecutionQuery().processInstanceBusinessKey(businessKey).singleResult())
but this causes a NPE as this return the process id of the parent process, not the subprocess.I tried searching by doing a query on the super process:ProcessInstance parentProcess = runtimeService.createProcessInstanceQuery()
.processInstanceBusinessKey(businessKey(vorderingsopdracht))
.singleResult();
ProcessInstance subProcess = runtimeService.createProcessInstanceQuery()
.superProcessInstanceId(parentProcess.getId())
.singleResult();
Execution execution = runtimeService.createExecutionQuery().
processInstanceId(subProcess.getId()).singleResult();
Unfortunately this fails as the superProcessInstanceId query returns no results.The only way I found to find a working execution is usingruntimeService.createExecutionQuery().
activityId("wachtenAfgewerkt").
singleResult();This obviously has the problem that I have a problem figuring out the correct execution if there is more than one.What is the suggested way to find the correct execution object?I am using 5.10-SNAPSHOT (as I am also using designer 5.9.2 and 5.9 does not recognize the .bpmn flows).