flowable/flowable-engine · error · FlowableIllegalArgumentException
Invalid value for enum form property: + value
Error message
Invalid value for enum form property: + value
What it means
EnumFormType.validateValue checks a submitted or stored enum form value against the configured 'values' map (the <flowable:value> entries in the BPMN). If the value is not among them, FlowableIllegalArgumentException 'Invalid value for enum form property: <value>' is thrown. It enforces that only declared enum options are accepted.
Solutions
- Submit one of the exact values declared via flowable:value entries in the BPMN form property.
- Align client-side dropdown options with the current BPMN values after a redeploy.
- Check case-sensitivity and trim whitespace on the submitted value.
- If dynamic options are needed, replace the enum form type with a custom FormType or store options as variables instead of form metadata.
Example fix
// before
properties.put("priority", "urgent"); // BPMN only defines low|medium|high
// after
properties.put("priority", "high"); // must match a flowable:value entry Defensive patterns
Strategy: validation
Validate before calling
Map<String,String> allowed = formService.getTaskFormData(taskId).getFormProperties().stream()
.filter(p -> p.getId().equals(enumField))
.map(FormProperty::getType)
.filter(EnumFormType.class::isInstance)
.map(p -> ((EnumFormType) p).getValues().keySet())
.findFirst().orElse(Set.of());
if (!allowed.contains(submittedValue)) {
throw new IllegalArgumentException("Allowed enum values: " + allowed);
} Try / catch
try {
formService.submitTaskFormData(taskId, properties);
} catch (FlowableIllegalArgumentException e) {
if (e.getMessage().startsWith("Invalid value for enum form property")) {
refreshAllowedEnumOptions(); // reload form metadata and retry with mapped value
} else { throw e; }
} Prevention
- Populate UI dropdowns from the form metadata, not hardcoded lists.
- Re-fetch form options after every BPMN redeploy.
- Compare submitted values case-sensitively and trim whitespace.
- Keep enum option sets identical wherever the same property id is reused.
When it happens
Trigger: FormService.submitTaskFormData/startProcessInstanceByForm with a property value not present in the enum's configured values, or setting the variable to an undocumented String which is then converted.
Common situations: BPMN form values updated (renamed options) while clients/old UI still submit old keys, case-sensitivity mismatches ('High' vs 'high'), values defined in one form property but reused with a different set elsewhere.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- form property '" + id + "' is not writable
- form property '" + id + "' is required
- invalid date value " + propertyValue
- Invalid value for enum form property
- Model value should be a String
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/3608157518ec63e5.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/form/EnumFormType.java:67
validateValue(propertyValue);
return propertyValue;
}
@Override
public String convertModelValueToFormValue(Object modelValue) {
if (modelValue != null) {
if (!(modelValue instanceof String)) {
throw new FlowableIllegalArgumentException("Model value should be a String");
}
validateValue((String) modelValue);
}
return (String) modelValue;
}
protected void validateValue(String value) {
if (value != null) {
if (values != null && !values.containsKey(value)) {
throw new FlowableIllegalArgumentException("Invalid value for enum form property: " + value);
}
}
}
}
View on GitHub (pinned to d6d39ce1c6)