flowable/flowable-engine · error · FlowableIllegalArgumentException
A non-null value is required for one of timeDate, timeDurati
Error message
A non-null value is required for one of timeDate, timeDuration, or timeCycle
What it means
RescheduleTimerJobCmd accepts exactly one of timeDate, timeDuration, or timeCycle as the new timer value. The constructor counts the non-null values among them: if all three are null (count 0) it throws this error, and if more than one is provided (count != 2 nulls, i.e. 2+ non-null) it throws a related error. Exactly one value must be supplied.
Source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/RescheduleTimerJobCmd.java:45
public class RescheduleTimerJobCmd implements Command<TimerJobEntity>, Serializable {
private static final long serialVersionUID = 1L;
private final String timerJobId;
private String timeDate;
private String timeDuration;
private String timeCycle;
private String endDate;
private String calendarName;
public RescheduleTimerJobCmd(String timerJobId, String timeDate, String timeDuration, String timeCycle, String endDate, String calendarName) {
if (timerJobId == null) {
throw new FlowableIllegalArgumentException("The timer job id is mandatory, but 'null' has been provided.");
}
int timeValues = Collections.frequency(Arrays.asList(timeDate, timeDuration, timeCycle), null);
if (timeValues == 0) {
throw new FlowableIllegalArgumentException("A non-null value is required for one of timeDate, timeDuration, or timeCycle");
} else if (timeValues != 2) {
throw new FlowableIllegalArgumentException("At most one non-null value can be provided for timeDate, timeDuration, or timeCycle");
}
if (endDate != null && timeCycle == null) {
throw new FlowableIllegalArgumentException("An end date can only be provided when rescheduling a timer using timeDuration.");
}
this.timerJobId = timerJobId;
this.timeDate = timeDate;
this.timeDuration = timeDuration;
this.timeCycle = timeCycle;
this.endDate = endDate;
this.calendarName = calendarName;
}
@Override
public TimerJobEntity execute(CommandContext commandContext) {View on GitHub (pinned to d6d39ce1c6)
Solutions
- Supply exactly one of timeDate (ISO date), timeDuration (ISO 8601 duration), or timeCycle (cron/repeat) as a non-null string.
- Validate the schedule value before calling; if it comes from config, check for presence and provide a default.
- Fix config loading so the time value key resolves correctly, and avoid passing empty strings where null checks are used.
Example fix
// before managementService.rescheduleTimeCycleJob(timerJobId, schedule, null, null, null); // schedule == null // after Objects.requireNonNull(schedule, "timeCycle schedule must be configured"); managementService.rescheduleTimeCycleJob(timerJobId, schedule, null, null, null);
Defensive patterns
Strategy: validation
Validate before calling
boolean hasExactlyOne = (timeDate != null ? 1 : 0) + (timeDuration != null ? 1 : 0) + (timeCycle != null ? 1 : 0) == 1;
if (!hasExactlyOne) {
throw new IllegalStateException("Provide exactly one of timeDate, timeDuration, or timeCycle");
} Try / catch
try {
managementService.rescheduleTimeCycleJob(timerJobId, timeCycle, null, null, null);
} catch (FlowableIllegalArgumentException e) {
// no (or multiple) time value(s) supplied; fall back to configured default schedule
} Prevention
- Validate schedule values come from non-null config before invoking the reschedule API.
- Build rescheduling helpers around a single discriminated parameter instead of three nullable ones.
- Provide default schedules in configuration so missing keys never surface as null arguments.
When it happens
Trigger: Calling managementService.rescheduleTimeDateJob/rescheduleTimeDurationJob/rescheduleTimeCycleJob with a null/empty time value, or constructing RescheduleTimerJobCmd directly with all three of timeDate, timeDuration, timeCycle set to null — e.g. reading the new schedule from config where the key was missing.
Common situations: Schedule values sourced from properties/environment where the expected key (e.g. cron expression) is absent; generic rescheduling helper methods that pass through whichever parameter the caller set, with the caller setting none; refactoring renamed config keys so the lookup yields null.
Related errors
- The timer job id is mandatory, but 'null' has been provided.
- Invalid usage: cannot use deployed() and notDeployed() in th
- Cannot combine onlyInbound() with onlyOutbound() in the same
- Cannot combine onlyOutbound() with onlyInbound() in the same
- Cannot combine onlyTimers() with onlyMessages() in the same
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/90687ff6a8766e83.
Report an issue: GitHub.