docs: public static void successCancellation(final JpaAction action, final ActionRepository actionRepository,
              final TargetRepository targetRepository) {
  
          // set action inactive
          action.setActive(false);
          action.setStatus(Status.CANCELED);
  
          final JpaTarget target = (JpaTarget) action.getTarget();
          final List<Action> nextActiveActions = actionRepository.findByTargetAndActiveOrderByIdAsc(target, true).stream()
                  .filter(a -> !a.getId().equals(action.getId())).collect(Collectors.toList());
  
          if (nextActiveActions.isEmpty()) {
              target.setAssignedDistributionSet(target.getInstalledDistributionSet());
              target.setUpdateStatus(TargetUpdateStatus.IN_SYNC);
          } else {
              target.setAssignedDistributionSet(nextActiveActions.get(0).getDistributionSet());
          }
  
          targetRepository.save(target);
      }