Activiti/Activiti · error · ActivitiException
couldn't resolve duedate:
Error message
couldn't resolve duedate:
What it means
DueDateBusinessCalendar.resolveDuedate resolves a duedate that is either an ISO-8601 date/time string (parsed with Joda's DateTime.parse) or an ISO-8601 period starting with 'P' (added to the current time). If any exception occurs while parsing the input string, it is wrapped in an ActivitiException with the message 'couldn't resolve duedate: ' plus the underlying cause. The real cause is in the wrapped exception, so inspect it to know which part of the input was unparseable.
Solutions
- Provide an ISO-8601 datetime such as '2024-06-01T10:15:00' (what DateTime.parse accepts).
- If the value is a relative offset, prefix it with 'P' (ISO-8601 period), e.g. 'P2DT4H' or 'PT30M'.
- Pre-parse or validate the string with java.time (OffsetDateTime.parse / Duration.parse) or DateTime.parse in a try-catch before assigning it to the timer configuration.
- Read the nested exception (getCause()) to identify the exact parse failure.
Example fix
// before String duedate = "01/06/2024 10:00"; // ActivitiException: couldn't resolve duedate // after String duedate = "2024-06-01T10:00:00"; // ISO-8601 datetime // or relative: String duedate = "PT30M";
Defensive patterns
Strategy: validation
Validate before calling
boolean isValidDueDateCalendarValue(String duedate) {
if (duedate == null || duedate.isEmpty()) return false;
try {
if (duedate.startsWith("P")) {
org.joda.time.Period.parse(duedate);
} else {
org.joda.time.DateTime.parse(duedate);
}
return true;
} catch (Exception e) {
return false;
}
} Try / catch
try {
Date d = calendarManager.getBusinessCalendar("dueDate").resolveDuedate(duedate);
} catch (ActivitiException e) {
log.error("Unparseable duedate '{}': must be ISO-8601 datetime or 'P'-prefixed period. Cause: {}", duedate, e.getCause(), e);
throw new IllegalArgumentException("duedate must be ISO-8601: " + duedate, e);
} Prevention
- Use ISO-8601 datetimes: '2024-06-01T10:15:00'.
- Prefix relative offsets with 'P' (e.g. 'P2DT4H'); periods without 'P' fail.
- Never pass human-readable dates like 'tomorrow' or '01/06/2024'.
- Pre-validate with DateTime.parse in tests covering all timer expressions in your process definitions.
When it happens
Trigger: Passing a string that is neither a parseable ISO-8601 datetime nor an ISO-8601 period, e.g. 'tomorrow', '2024/01/01', 'not-a-date', or a period without the leading 'P' like 'T1D'.
Common situations: Configuring a timer/job dueDate with a human-readable date instead of ISO-8601 ('01-02-2024 10:00'); using locale-dependent formats; date-string built by string concatenation with wrong separators; confusion between this calendar and the default/duration calendars that accept other syntaxes.
Related errors
- Cannot parse duration
- couldn't resolve duedate:
- invalid duedate format:
- businessCalendars can not be null
- Cannot combine onlyTimers() with onlyMessages() in the same…
AI-assisted analysis of Activiti/Activiti@56435b1a97 (2026-09-09).
Data as JSON: /api/errors/510b51ac242b83b1.
Report an issue: GitHub.
Appendix: source
Thrown at activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/calendar/DueDateBusinessCalendar.java:44
public class DueDateBusinessCalendar extends BusinessCalendarImpl {
public static final String NAME = "dueDate";
public DueDateBusinessCalendar(ClockReader clockReader) {
super(clockReader);
}
@Override
public Date resolveDuedate(String duedate, int maxIterations) {
try {
// check if due period was specified
if (duedate.startsWith("P")) {
return new DateTime(clockReader.getCurrentTime()).plus(Period.parse(duedate)).toDate();
}
return DateTime.parse(duedate).toDate();
} catch (Exception e) {
throw new ActivitiException("couldn't resolve duedate: " + e.getMessage(), e);
}
}
}
View on GitHub (pinned to 56435b1a97)