{"record":{"id":"8fda57d25ebc3a94","repo":"flowable/flowable-engine","slug":"illegal-value-for-delegationstate-delegationsta","errorCode":null,"errorMessage":"Illegal value for delegationState: ${delegationState}","messagePattern":"Illegal value for delegationState: (.+?)","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":409,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskBaseResource.java","lineNumber":82,"sourceCode":"\n    @Autowired\n    protected CmmnTaskService taskService;\n\n    @Autowired\n    protected CmmnHistoryService historyService;\n\n    @Autowired(required=false)\n    protected CmmnRestApiInterceptor restApiInterceptor;\n\n    protected DelegationState getDelegationState(String delegationState) {\n        DelegationState state = null;\n        if (delegationState != null) {\n            if (DelegationState.RESOLVED.name().toLowerCase().equals(delegationState)) {\n                return DelegationState.RESOLVED;\n            } else if (DelegationState.PENDING.name().toLowerCase().equals(delegationState)) {\n                return DelegationState.PENDING;\n            } else {\n                throw new FlowableIllegalArgumentException(\"Illegal value for delegationState: \" + delegationState);\n            }\n        }\n        return state;\n    }\n\n    /**\n     * Populate the task based on the values that are present in the given {@link TaskRequest}.\n     */\n    protected void populateTaskFromRequest(Task task, TaskRequest taskRequest) {\n        if (taskRequest.isNameSet()) {\n            task.setName(taskRequest.getName());\n        }\n        if (taskRequest.isAssigneeSet()) {\n            task.setAssignee(taskRequest.getAssignee());\n        }\n        if (taskRequest.isDescriptionSet()) {\n            task.setDescription(taskRequest.getDescription());\n        }","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskBaseResource.java#L64-L100","documentation":"TaskBaseResource.getDelegationState converts a query parameter string into the DelegationState enum, accepting only the lowercase names 'resolved' and 'pending'. Any other value cannot be mapped, so FlowableIllegalArgumentException is thrown with the offending value.","triggerScenarios":"Task query REST call with delegationState=<value> where value is not 'pending' or 'resolved' (e.g. 'PENDING' uppercase, 'delegated', an empty string, or 'involved').","commonSituations":"Passing the raw enum name in uppercase; UI dropdowns listing states not valid for task queries; copied values from process-instance APIs that support extra states.","solutions":["Send delegationState=pending or delegationState=resolved (lowercase).","Omit the parameter entirely when you do not want to filter on delegation state.","Whitelist/normalize the value in the client before building the query.","Catch the 400 response and correct the parameter."],"exampleFix":"// before\nGET /runtime/tasks?delegationState=PENDING\n// after\nGET /runtime/tasks?delegationState=pending","handlingStrategy":"validation","validationCode":"if (delegationState != null && !['pending','resolved'].includes(delegationState)) throw new Error('delegationState must be pending or resolved');","typeGuard":"const isDelegationState = (s) => s === 'pending' || s === 'resolved';","tryCatchPattern":"try { await queryTasks({delegationState}); } catch (e) { if (e.status === 400 && /delegationState/.test(e.message)) { delete params.delegationState; } else { throw e; } }","preventionTips":["Send lowercase enum names","Only include the parameter when filtering is intended","Map UI enum values through a lowercase normalization step"],"tags":["rest-api","enum","query-parameters"],"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"}