docs: @Override
      public Long scheduleRequest(String commandId, Date date, CommandContext ctx) {
  
          if (ctx == null) {
              throw new IllegalStateException("A Context Must Be Provided! ");
          }
          String businessKey = (String) ctx.getData("businessKey");
          RequestInfo requestInfo = new RequestInfo();
          requestInfo.setCommandName(commandId);
          requestInfo.setKey(businessKey);
          requestInfo.setStatus(STATUS.QUEUED);
          requestInfo.setTime(date == null ? new Date() : date);
          requestInfo.setMessage("Ready to execute");
          requestInfo.setDeploymentId(getDeploymentId(ctx));
          if (ctx.getData("processInstanceId") != null) {
              requestInfo.setProcessInstanceId(((Number) ctx.getData("processInstanceId")).longValue());
          }
          requestInfo.setOwner((String) ctx.getData("owner"));
          if (ctx.getData("retries") != null) {
              requestInfo.setRetries(Integer.valueOf(String.valueOf(ctx.getData("retries"))));
          } else {
              requestInfo.setRetries(retries);
          }
          int priority = DEFAULT_PRIORITY;
          if (ctx.getData("priority") != null) {
              priority = (Integer) ctx.getData("priority");
              if (priority < MIN_PRIORITY) {
                  logger.warn("Priority {} is not valid (cannot be less than {}) setting it to {}", MIN_PRIORITY, MIN_PRIORITY, priority);
                  priority = MIN_PRIORITY;
  
              } else if (priority > MAX_PRIORITY) {
                  logger.warn("Priority {} is not valid (cannot be more than {}) setting it to {}", MAX_PRIORITY, MAX_PRIORITY, priority);
                  priority = MAX_PRIORITY;
              }
  
          }
          requestInfo.setPriority(priority);
  
          if (ctx.getData("retryDelay") != null) {
              List<Long> retryDelay = new ArrayList<Long>();
              String[] timeExpressions = ((String) ctx.getData("retryDelay")).split(",");
  
              for (String timeExpr : timeExpressions) {
                  retryDelay.add(TimeUtils.parseTimeString(timeExpr));
              }
              ctx.setData("retryDelay", retryDelay);
          }
  
          if (ctx != null) {
              try {
                  ByteArrayOutputStream bout = new ByteArrayOutputStream();
                  ObjectOutputStream oout = new ObjectOutputStream(bout);
                  oout.writeObject(ctx);
                  requestInfo.setRequestData(bout.toByteArray());
              } catch (IOException e) {
                  logger.warn("Error serializing context data", e);
                  requestInfo.setRequestData(null);
              }
          }
          eventSupport.fireBeforeJobScheduled(requestInfo, null);
          try {
              
              Consumer<Object> function = null;
              if (useJMS) {
                  // send JMS only for immediate job requests not for these that should be executed in future                 
                  if (date == null) {
                      executorStoreService.persistRequest(requestInfo, null);
                      logger.debug("Sending JMS message to trigger job execution for job {}", requestInfo.getId());
                      // send JMS message to trigger processing
                      sendMessage(String.valueOf(requestInfo.getId()), priority);
                  } else {
                      logger.debug("JMS message not sent for job {} as the job should not be executed immediately but at {}", requestInfo.getId(), date);
                      function = scheduleExecution(requestInfo, date);
                      executorStoreService.persistRequest(requestInfo, function);
                  }
              } else {
                  logger.debug("Scheduling request {} for execution at {}", requestInfo.getId(), requestInfo.getTime());
                  function = scheduleExecution(requestInfo, date);
                  executorStoreService.persistRequest(requestInfo, function);
              }
              
              
  
              logger.debug("Scheduled request for Command: {} - requestId: {} with {} retries", commandId, requestInfo.getId(), requestInfo.getRetries());
              eventSupport.fireAfterJobScheduled(requestInfo, null);
          } catch (Throwable e) {
              eventSupport.fireAfterJobScheduled(requestInfo, e);
          }
          return requestInfo.getId();
      }