Source:
<code>public void testAbortedParentProcessAndChildProcessInProcessInstanceListWithNotIndenpendentSubProcess() { assertNotNull(deploymentService); KModuleDeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION); deploymentService.deploy(deploymentUnit); units.add(deploymentUnit); assertNotNull(processService); boolean isDeployed = deploymentService.isDeployed(deploymentUnit.getIdentifier()); assertTrue(isDeployed); assertNotNull(processService); long parentProcessInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "testone.parentWithNotIndepententSubProcess"); assertNotNull(parentProcessInstanceId); ProcessInstance pi = processService.getProcessInstance(parentProcessInstanceId); assertNotNull(pi); <START> ProcessInstance subPiOne = processService.getProcessInstance(2l); <END> ProcessInstance subPiTwo = processService.getProcessInstance(3l); assertNotNull(subPiOne); assertNotNull(subPiTwo); assertEquals(parentProcessInstanceId, subPiOne.getParentProcessInstanceId()); assertEquals(parentProcessInstanceId, subPiTwo.getParentProcessInstanceId()); List<Long> processInstanceList = Arrays.asList(new Long[]{parentProcessInstanceId, 2l, 3l}); processService.abortProcessInstances(processInstanceList); ProcessInstance parent = processService.getProcessInstance(parentProcessInstanceId); assertNull(parent); ProcessInstance childOne = processService.getProcessInstance(2l); ProcessInstance childTwo = processService.getProcessInstance(3l); assertNull(childOne); assertNull(childTwo); }</code><technical_language>problem is fixed ids for child processes, work persistence is used. Try this: suggestion Collection<ProcessInstanceDesc> instances = runtimeDataService.getProcessInstancesByParent(parentProcessInstanceId, Arrays.asList(ProcessInstance.STATE_ACTIVE), new QueryContext()); assertNotNull(instances); assertEquals(2, instances.size()); List<Long> processInstanceList = instances.stream().map(p -> p.getId()).collect(Collectors.toList()); processInstanceList.add(0, parentProcessInstanceId); processService.abortProcessInstances(processInstanceList); ProcessInstance parent = processService.getProcessInstance(parentProcessInstanceId); assertNull(parent); instances = runtimeDataService.getProcessInstancesByParent(parentProcessInstanceId, Arrays.asList(ProcessInstance.STATE_ABORTED), new QueryContext()); assertNotNull(instances); assertEquals(2, instances.size());</technical_language>

Target:
public void testAbortedParentProcessAndChildProcessInProcessInstanceListWithNotIndenpendentSubProcess() { assertNotNull(deploymentService); KModuleDeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION); deploymentService.deploy(deploymentUnit); units.add(deploymentUnit); assertNotNull(processService); boolean isDeployed = deploymentService.isDeployed(deploymentUnit.getIdentifier()); assertTrue(isDeployed); assertNotNull(processService); long parentProcessInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "testone.parentWithNotIndepententSubProcess"); assertNotNull(parentProcessInstanceId); ProcessInstance pi = processService.getProcessInstance(parentProcessInstanceId); assertNotNull(pi); testResultForAbortedParentProcessAndChildProcessInProcessInstanceList(parentProcessInstanceId); }