docs: public static Function<DeploymentUnit, Boolean> abortUnitActiveProcessInstances(final RuntimeDataService runtimeDataService, final DeploymentService deploymentService) {
          return unit -> {
              Collection<ProcessInstanceDesc> activeProcesses = runtimeDataService.getProcessInstancesByDeploymentId(unit.getIdentifier(), activeProcessInstancessStates, new QueryContext(0, -1));
  
              DeployedUnit deployedUnit = deploymentService.getDeployedUnit(unit.getIdentifier());
  
              if (deployedUnit == null) {
                  throw new IllegalStateException("Undeploy forbidden - No deployments available for " + unit.getIdentifier());
              }
  
              for (ProcessInstanceDesc instanceDesc : activeProcesses) {
                  RuntimeManager manager = deployedUnit.getRuntimeManager();
                  RuntimeEngine engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get(instanceDesc.getId()));
                  try {
                      KieSession ksession = engine.getKieSession();
                      ksession.abortProcessInstance(instanceDesc.getId());
                  } catch (Exception e) {
                      logger.error("Undeploy forbidden - Error aborting process instances for deployment unit {} due to: {}", unit.getIdentifier(), e.getMessage());
                      return false;
                  } finally {
                      manager.disposeRuntimeEngine(engine);
                  }
              }
  
              return true;
          };
      }