code: public synchronized void schedule(ScheduledJob scheduledJob) {
      String id = scheduledJob.getId();
      String cronExpression = scheduledJob.getCronExpression();
      String name = scheduledJob.getName();
  
      // Validate cron expression
      if (!CronExpression.isValidExpression(cronExpression)) {
        throw new MolgenisValidationException(
            singleton(
                new ConstraintViolation("Invalid cronexpression '" + cronExpression + "'", null)));
      }
  
      try {
        // If already scheduled, remove it from the quartzScheduler
        if (quartzScheduler.checkExists(new JobKey(id, SCHEDULED_JOB_GROUP))) {
          unschedule(id);
        }
  
        // If not active, do not schedule it
        if (!scheduledJob.getBoolean(ScheduledJobMetadata.ACTIVE)) {
          return;
        }
  
        // Schedule with 'cron' trigger
        Trigger trigger =
            newTrigger()
                .withIdentity(id, SCHEDULED_JOB_GROUP)
                .withSchedule(cronSchedule(cronExpression))
                .build();
        schedule(scheduledJob, trigger);
  
        LOG.info("Scheduled Job '{}' with trigger '{}'", name, trigger);
      } catch (SchedulerException e) {
        LOG.error("Error schedule job", e);
        throw new ScheduledJobException("Error schedule job", e);
      }
    }
docs: Schedule a {@link ScheduledJob} with a cron expression defined in the entity.
  
  <p>Reschedules job if the job already exists.
  
  <p>If active is false, it unschedules the job
  
  @param scheduledJob the {@link ScheduledJob} to schedule