{"record":{"id":"31be420889313ca5","repo":"flowable/flowable-engine","slug":"the-given-variable-value-is-not-a-localdate","errorCode":null,"errorMessage":"The given variable value is not a localDate: '\" + result.getValue() + \"'","messagePattern":"The given variable value is not a localDate: '\" \\+ result\\.getValue\\(\\) \\+ \"'","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-common-rest/src/main/java/org/flowable/common/rest/variable/LocalDateRestVariableConverter.java","lineNumber":44,"sourceCode":"    public String getRestTypeName() {\n        return \"localDate\";\n    }\n\n    @Override\n    public Class<?> getVariableType() {\n        return LocalDate.class;\n    }\n\n    @Override\n    public Object getVariableValue(EngineRestVariable result) {\n        if (result.getValue() != null) {\n            if (!(result.getValue() instanceof String)) {\n                throw new FlowableIllegalArgumentException(\"Converter can only convert string to localDate\");\n            }\n            try {\n                return LocalDate.parse((String) result.getValue());\n            } catch (DateTimeParseException e) {\n                throw new FlowableIllegalArgumentException(\"The given variable value is not a localDate: '\" + result.getValue() + \"'\", e);\n            }\n        }\n        return null;\n    }\n\n    @Override\n    public void convertVariableValue(Object variableValue, EngineRestVariable result) {\n        if (variableValue != null) {\n            if (!(variableValue instanceof LocalDate)) {\n                throw new FlowableIllegalArgumentException(\"Converter can only convert localDate\");\n            }\n            result.setValue(variableValue.toString());\n        } else {\n            result.setValue(null);\n        }\n    }\n\n}","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-common-rest/src/main/java/org/flowable/common/rest/variable/LocalDateRestVariableConverter.java#L26-L62","documentation":"After confirming the REST value is a String, LocalDateRestVariableConverter.getVariableValue attempts LocalDate.parse. If the string is not a valid ISO-8601 date (yyyy-MM-dd), the DateTimeParseException is wrapped in FlowableIllegalArgumentException with the offending value in the message and the parse exception as cause.","triggerScenarios":"Posting a localDate REST variable whose string value is not parseable by LocalDate.parse: e.g. \"10-09-2026\", \"2026/09/10\", \"2026-09-10T10:00:00\", \"20260910\", or an empty string.","commonSituations":"Locale-dependent date formatting from clients (dd/MM/yyyy), datetime strings sent to date-only variables, timezone-suffixed strings, whitespace or empty values from form inputs.","solutions":["Format the value as ISO-8601 yyyy-MM-dd (e.g. LocalDate.toString() or DateTimeFormatter.ISO_LOCAL_DATE) before sending.","Validate/parse the string client-side with LocalDate.parse to fail fast with a clearer message.","If the value includes a time part, switch the variable to localDateTime type or strip the time.","Normalize client date pickers to output ISO format."],"exampleFix":"// before\nvariable.setValue(\"10/09/2026\");\n\n// after\nvariable.setValue(LocalDate.of(2026, 9, 10).toString()); // \"2026-09-10\"","handlingStrategy":"validation","validationCode":"try {\n    LocalDate.parse(value);\n} catch (DateTimeParseException e) {\n    throw new IllegalArgumentException(\"Value must be ISO yyyy-MM-dd, got: \" + value, e);\n}","typeGuard":"static boolean isValidIsoLocalDate(String s) {\n    try { LocalDate.parse(s); return true; } catch (DateTimeParseException | NullPointerException e) { return false; }\n}","tryCatchPattern":"try {\n    Object value = converter.getVariableValue(restVar);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getCause() instanceof DateTimeParseException dpe) {\n        log.error(\"localDate '{}' is not ISO yyyy-MM-dd\", restVar.getValue(), dpe);\n    }\n}","preventionTips":["Use LocalDate.toString() or DateTimeFormatter.ISO_LOCAL_DATE for serialization, never custom formats.","Normalize client date pickers to ISO output.","Reject or convert datetime-with-time strings before sending to localDate variables."],"tags":["localdate","date-parse","invalid-format","rest-variable"],"backgroundTag":"invalid-date-format","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"}