{"record":{"id":"7346d68230a30e04","repo":"flowable/flowable-engine","slug":"using-joda-time-datetime-has-been-deprecated-and-w-7346d6","errorCode":null,"errorMessage":"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. ","messagePattern":"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\\. ","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":66,"sourceCode":"        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":48,"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#L48-L76","documentation":"A deprecation warning logged by JodaDateTimeType.setValue when a process/task/scope variable holds a Joda-Time DateTime. Flowable stores it as millis and warns that Joda-Time support will be removed in a future version. It is not thrown, only logged; the variable is still persisted.","triggerScenarios":"Setting a variable to an org.joda.time.DateTime via e.g. execution.setVariable(\"x\", dateTime) or a JodaDateTimeType instance when the variable has no taskId but a sub-scope (scopeType/scopeId/subScopeId logged).","commonSituations":"Legacy Activiti 5/6 codebases upgraded to Flowable that still use Joda-Time types; date-handling utilities written pre-java.time migration.","solutions":["Migrate the variable value to java.time.Instant or java.util.Date before setting it","Replace org.joda.time.DateTime with java.time.Instant/OffsetDateTime in the code that creates the value","If Joda must stay temporarily, accept the warning and plan removal before the next Flowable major upgrade"],"exampleFix":"// before\nexecution.setVariable(\"dueDate\", org.joda.time.DateTime.now());\n// after\nexecution.setVariable(\"dueDate\", java.time.Instant.now());","handlingStrategy":"validation","validationCode":"if (value instanceof org.joda.time.DateTime) { throw new IllegalArgumentException(\"use java.time instead of Joda DateTime for variable \" + name); }","typeGuard":"boolean isJodaDateTime(Object v) { return v instanceof org.joda.time.DateTime; }","tryCatchPattern":null,"preventionTips":["Ban org.joda.time types in new code via Checkstyle/ArchUnit rules","Convert Joda values to java.time at system boundaries","Audit variable-setting code for legacy date types"],"tags":["deprecation","joda-time","variables"],"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"}