} else {
targetProcessInstanceId = new Long(instance.getRootProcessInstanceId());
}
ProcessInstanceDAOType piDAOF = ProcessInstanceDAOType.getInstance(instance.getProcessTransactionContext());
ProcessInstanceDAO piDAO = piDAO = piDAOF.getSiblingProcessInstances(targetProcessInstanceId, this.isTerminateRunAndForgetSubProcess());
Hashtable options = new Hashtable();
options.put("ptc", instance.getProcessTransactionContext());
while (piDAO.next()) {
ProcessInstance theInstance = ProcessInstance.create().getInstance(piDAO.getInstId().toString(), options);
theInstance.stop(terminateStatus);
if (targetPI != null && targetPI.isSubProcess()) {
targetPI.getProcessDefinition().returnToMainProcess(targetPI);
}
}