{"record":{"id":"6a67d17e74c25783","repo":"flowable/flowable-engine","slug":"using-joda-time-datetime-has-been-deprecated-and-w-6a67d1","errorCode":null,"errorMessage":"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. ","messagePattern":"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\\. ","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":62,"sourceCode":"\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":44,"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#L44-L76","documentation":"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.","triggerScenarios":"runtimeService.setVariable(processInstanceId, name, jodaDateTimeValue) or any variable creation where ValueFields.getProcessInstanceId() != null and the value is org.joda.time.DateTime.","commonSituations":"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.","solutions":["Replace the Joda DateTime with java.time.OffsetDateTime/Instant before storing the variable.","Update expressions/scripts in the process that manipulate the variable to expect java.time types.","Grep codebase for org.joda.time usage feeding setVariable and migrate all call sites.","Plan removal before upgrading past the Flowable version that deletes JodaDateTimeType."],"exampleFix":"// before\nruntimeService.setVariable(procInstId, \"startTime\", DateTime.now());\n// after\nruntimeService.setVariable(procInstId, \"startTime\", Instant.now());","handlingStrategy":"type-guard","validationCode":"public static Object safeVariable(Object v) {\n  if (v instanceof org.joda.time.DateTime dt) return dt.toInstant();\n  return v;\n}\nruntimeService.setVariable(procInstId, name, safeVariable(value));","typeGuard":"static boolean isJodaDateTime(Object v) {\n  return v instanceof org.joda.time.DateTime;\n}","tryCatchPattern":null,"preventionTips":["Replace org.joda.time.DateTime with Instant/OffsetDateTime at variable write sites.","Audit expressions and scripts that read/write process variables for Joda types.","Track the Flowable upgrade notes removing Joda variable support."],"tags":["variables","joda-time","deprecation","process-instance"],"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"}