{"record":{"id":"6e5e86a3d04c61d0","repo":"flowable/flowable-engine","slug":"invalid-value-for-enum-form-property-value-6e5e86","errorCode":null,"errorMessage":"Invalid value for enum form property: ${value}","messagePattern":"Invalid value for enum form property: (.+?)","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/form/EnumFormType.java","lineNumber":67,"sourceCode":"        validateValue(propertyValue);\n        return propertyValue;\n    }\n\n    @Override\n    public String convertModelValueToFormValue(Object modelValue) {\n        if (modelValue != null) {\n            if (!(modelValue instanceof String)) {\n                throw new ActivitiIllegalArgumentException(\"Model value should be a String\");\n            }\n            validateValue((String) modelValue);\n        }\n        return (String) modelValue;\n    }\n\n    protected void validateValue(String value) {\n        if (value != null) {\n            if (values != null && !values.containsKey(value)) {\n                throw new ActivitiIllegalArgumentException(\"Invalid value for enum form property: \" + value);\n            }\n        }\n    }\n\n}\n","sourceCodeStart":49,"sourceCodeEnd":73,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/form/EnumFormType.java#L49-L73","documentation":"Thrown by EnumFormType.validateValue (invoked from both convertFormValueToModelValue and convertModelValueToFormValue) when a value for an enum form property is not null and is not a key of the configured 'values' map. The enum form type only accepts values explicitly listed in the form property definition (activiti:values in BPMN or the values map passed to the constructor).","triggerScenarios":"Submitting or rendering an enum form property with a value like \"urgent\" when the enum definition only contains keys such as low/normal/high; also hit when the values map is null and validation is skipped, vs present and missing the key.","commonSituations":"Client submits a stale value after the allowed enum set changed in a redeployed model; typos/case mismatches ('High' vs 'high'); values added in the UI but not in the BPMN form property definition.","solutions":["Submit only values present in the form property's configured values map (check the BPMN activiti:values).","Align case-sensitivity: enum keys are matched exactly, normalize input to the defined keys.","Update the process model's enum values and redeploy when new options are needed, then refresh client-side lists.","Validate user input against the form data via formService.getTaskFormData(taskId).getFormProperties() before submitting."],"exampleFix":"// before\nformProperties.put(\"priority\", \"urgent\"); // not in enum values\n// after\nif (allowedValues.contains(\"critical\")) {\n    formProperties.put(\"priority\", \"critical\");\n}","handlingStrategy":"validation","validationCode":"Map<String,String> allowed = enumFormType.getValues(); // or parse BPMN activiti:values\nif (value != null && !allowed.containsKey(value)) {\n    throw new IllegalArgumentException(\"Value not allowed: \" + value + \", allowed: \" + allowed.keySet());\n}","typeGuard":null,"tryCatchPattern":"try {\n    formService.submitTaskFormData(taskId, props);\n} catch (org.activiti.engine.ActivitiIllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Invalid value for enum form property\")) {\n        props.put(\"priority\", allowedKeys.stream().filter(k -> k.equalsIgnoreCase(submitted)).findFirst().orElse(null));\n    }\n}","preventionTips":["Validate input against the enum values map before submission.","Keep UI option lists generated from the same BPMN values.","Remember keys are case-sensitive.","Redeploy the model and refresh clients together when enum options change."],"tags":["forms","enum","validation","invalid-value"],"backgroundTag":"invalid-enum-value","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"}