Change the repeat in Runtime

@Yana , @Niall
With managementService we can change the dueDate but we cannot change the Repeat.
How can we change the repeat?

private void updateTimer(String processId, String cronJobExpression) {
		final Job job = managementService.createJobQuery().processDefinitionKey(processId).timers().singleResult();
		if (job != null) {
			Date newDueDateFromCronJobExpression = getNextDateFor(cronJobExpression);
			managementService.setJobDuedate(job.getId(), newDueDateFromCronJobExpression);
			log.info("Timer for " + processId + " was updated. Next run date: " + newDueDateFromCronJobExpression);
		} else {
			log.error("No timer was found for processId: " + processId);
		}
	}

image

Hi @dawdaw_dawdaw

The repeat is the timer definition and it’s set only during the initialization of the job. [1]
It cannot be changed dynamically after that.
We only offer the option to adjust the due date that you already found. [2]

1: Defining a Timer | Timer Events | docs.camunda.org
2: Modify a Time Cycle | Timer Events | docs.camunda.org

Ok, Danke Dir.