{"record":{"id":"d682aae20b364c2c","repo":"flowable/flowable-engine","slug":"using-joda-time-datetime-has-been-deprecated-and-w","errorCode":null,"errorMessage":"Using Joda-Time DateTime has been deprecated and will be removed in a future version. Task Variable {} in task {} was a Joda-Time DateTime. ","messagePattern":"Using Joda-Time DateTime has been deprecated and will be removed in a future version\\. Task Variable (.+?) in task (.+?) was a Joda-Time DateTime\\. ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/types/JodaDateTimeType.java","lineNumber":58,"sourceCode":"            return true;\n        }\n        return DateTime.class.isAssignableFrom(value.getClass());\n    }\n\n    @Override\n    public Object getValue(ValueFields valueFields) {\n        Long longValue = valueFields.getLongValue();\n        if (longValue != null) {\n            return new DateTime(longValue);\n        }\n        return null;\n    }\n\n    @Override\n    public void setValue(Object value, ValueFields valueFields) {\n        if (value != null) {\n            if (valueFields.getTaskId() != null) {\n                JodaDeprecationLogger.LOGGER.warn(\n                        \"Using Joda-Time DateTime has been deprecated and will be removed in a future version. Task Variable {} in task {} was a Joda-Time DateTime. \",\n                        valueFields.getName(), valueFields.getTaskId());\n            } else if (valueFields.getProcessInstanceId() != null) {\n                JodaDeprecationLogger.LOGGER.warn(\n                        \"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. \",\n                        valueFields.getName(), valueFields.getProcessInstanceId(), valueFields.getExecutionId());\n            } else {\n                JodaDeprecationLogger.LOGGER.warn(\n                        \"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. \",\n                        valueFields.getName(), valueFields.getScopeType(), valueFields.getScopeId(), valueFields.getSubScopeId());\n            }\n            valueFields.setLongValue(((DateTime) value).getMillis());\n        } else {\n            valueFields.setLongValue(null);\n        }\n    }\n}\n","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/types/JodaDateTimeType.java#L40-L76","documentation":"Flowable deprecated Joda-Time variable types. When a task-scoped variable with a org.joda.time.DateTime value is stored (setValue on JodaDateTimeType) and the ValueFields has a taskId, a deprecation warning naming the variable and task is logged, telling you Joda-Time DateTime support will be removed.","triggerScenarios":"Calling variableService/TaskService APIs to set a task variable whose value is a Joda DateTime — e.g. taskService.setVariableLocal(taskId, name, dateTimeValue) or engine-internal variable creation with a DateTime object while taskId != null.","commonSituations":"Legacy process/Java code still using Joda-Time after migration guidance; old libraries returning DateTime that is passed straight into setVariable; upgrading Flowable where Joda support is being phased out.","solutions":["Convert the value to java.time.OffsetDateTime/Instant (or java.util.Date) before setting the variable.","Migrate stored variable values to the Flowable java-time compatible types on next write.","Suppress only if temporary: plan removal before upgrading to the version dropping Joda support.","Audit variable writes for Joda types (search for org.joda.time in setVariable call sites)."],"exampleFix":"// before\ntaskService.setVariableLocal(taskId, \"dueDate\", org.joda.time.DateTime.now());\n// after\ntaskService.setVariableLocal(taskId, \"dueDate\", java.time.OffsetDateTime.now());","handlingStrategy":"type-guard","validationCode":"public static Object normalizeVar(Object v) {\n  if (v instanceof org.joda.time.DateTime dt) return dt.toDate();\n  return v;\n}\ntaskService.setVariableLocal(taskId, name, normalizeVar(value));","typeGuard":"static boolean isJodaDateTime(Object v) {\n  return v instanceof org.joda.time.DateTime;\n}","tryCatchPattern":null,"preventionTips":["Ban org.joda.time in new code (enforce via ArchUnit/Checkstyle import rules).","Convert Joda values at API boundaries before storing engine variables.","Migrate variable handling to java.time types project-wide."],"tags":["variables","joda-time","deprecation","task"],"backgroundTag":"deprecated-api-usage","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}