flowable/flowable-engine · warning

Using Joda-Time DateTime has been deprecated and will be…

Error message

Using Joda-Time DateTime has been deprecated and will be removed in a future version. Process Variable {} in process instance {} and execution {} was a Joda-Time DateTime. 

What it means

Same Joda-Time deprecation as the task-variable case, but for process-scoped variables: storing a variable whose value is a Joda DateTime with a non-null processInstanceId logs this warning including variable name, process instance id and execution id, because Joda DateTime support is scheduled for removal.

Solutions

  1. Replace the Joda DateTime with java.time.OffsetDateTime/Instant before storing the variable.
  2. Update expressions/scripts in the process that manipulate the variable to expect java.time types.
  3. Grep codebase for org.joda.time usage feeding setVariable and migrate all call sites.
  4. Plan removal before upgrading past the Flowable version that deletes JodaDateTimeType.

Example fix

// before
runtimeService.setVariable(procInstId, "startTime", DateTime.now());
// after
runtimeService.setVariable(procInstId, "startTime", Instant.now());
Defensive patterns

Strategy: type-guard

Validate before calling

public static Object safeVariable(Object v) {
  if (v instanceof org.joda.time.DateTime dt) return dt.toInstant();
  return v;
}
runtimeService.setVariable(procInstId, name, safeVariable(value));

Type guard

static boolean isJodaDateTime(Object v) {
  return v instanceof org.joda.time.DateTime;
}

Prevention

When it happens

Trigger: runtimeService.setVariable(processInstanceId, name, jodaDateTimeValue) or any variable creation where ValueFields.getProcessInstanceId() != null and the value is org.joda.time.DateTime.

Common situations: Legacy process code writing Joda DateTimes into process variables; libraries that still return DateTime; gradual Flowable upgrade where Joda types still compile but are deprecated.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/6a67d17e74c25783. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/types/JodaDateTimeType.java:62

    @Override
    public Object getValue(ValueFields valueFields) {
        Long longValue = valueFields.getLongValue();
        if (longValue != null) {
            return new DateTime(longValue);
        }
        return null;
    }

    @Override
    public void setValue(Object value, ValueFields valueFields) {
        if (value != null) {
            if (valueFields.getTaskId() != null) {
                JodaDeprecationLogger.LOGGER.warn(
                        "Using Joda-Time DateTime has been deprecated and will be removed in a future version. Task Variable {} in task {} was a Joda-Time DateTime. ",
                        valueFields.getName(), valueFields.getTaskId());
            } else if (valueFields.getProcessInstanceId() != null) {
                JodaDeprecationLogger.LOGGER.warn(
                        "Using Joda-Time DateTime has been deprecated and will be removed in a future version. Process Variable {} in process instance {} and execution {} was a Joda-Time DateTime. ",
                        valueFields.getName(), valueFields.getProcessInstanceId(), valueFields.getExecutionId());
            } else {
                JodaDeprecationLogger.LOGGER.warn(
                        "Using Joda-Time DateTime has been deprecated and will be removed in a future version. Variable {} in {} instance {} and sub-scope {} was a Joda-Time DateTime. ",
                        valueFields.getName(), valueFields.getScopeType(), valueFields.getScopeId(), valueFields.getSubScopeId());
            }
            valueFields.setLongValue(((DateTime) value).getMillis());
        } else {
            valueFields.setLongValue(null);
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)