{"record":{"id":"15187ae8a34e6728","repo":"flowable/flowable-engine","slug":"invalid-action","errorCode":null,"errorMessage":"Invalid action: '","messagePattern":"Invalid action: '","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskResource.java","lineNumber":138,"sourceCode":"        }\n\n        if (TaskActionRequest.ACTION_COMPLETE.equals(actionRequest.getAction())) {\n            completeTask(task, actionRequest);\n\n        } else if (TaskActionRequest.ACTION_CLAIM.equals(actionRequest.getAction())) {\n            claimTask(task, actionRequest);\n\n        } else if (TaskActionRequest.ACTION_UNCLAIM.equals(actionRequest.getAction())) {\n            unclaimTask(task);\n\n        } else if (TaskActionRequest.ACTION_DELEGATE.equals(actionRequest.getAction())) {\n            delegateTask(task, actionRequest);\n\n        } else if (TaskActionRequest.ACTION_RESOLVE.equals(actionRequest.getAction())) {\n            resolveTask(task, actionRequest);\n\n        } else {\n            throw new FlowableIllegalArgumentException(\"Invalid action: '\" + actionRequest.getAction() + \"'.\");\n        }\n    }\n\n    @ApiOperation(value = \"Delete a task\", tags = { \"Tasks\" }, code = 204)\n    @ApiImplicitParams({\n            @ApiImplicitParam(name = \"cascadeHistory\", dataType = \"string\", value = \"Whether or not to delete the HistoricTask instance when deleting the task (if applicable). If not provided, this value defaults to false.\", paramType = \"query\"),\n            @ApiImplicitParam(name = \"deleteReason\", dataType = \"string\", value = \"Reason why the task is deleted. This value is ignored when cascadeHistory is true.\", paramType = \"query\")\n    })\n    @ApiResponses(value = {\n            @ApiResponse(code = 204, message = \"Indicates the task was found and has been deleted. Response-body is intentionally empty.\"),\n            @ApiResponse(code = 403, message = \"Indicates the requested task cannot be deleted because it’s part of a workflow.\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested task was not found.\")\n    })\n    @DeleteMapping(value = \"/cmmn-runtime/tasks/{taskId}\")\n    @ResponseStatus(HttpStatus.NO_CONTENT)\n    public void deleteTask(@ApiParam(name = \"taskId\") @PathVariable String taskId, @ApiParam(hidden = true) @RequestParam(value = \"cascadeHistory\", required = false) Boolean cascadeHistory,\n            @ApiParam(hidden = true) @RequestParam(value = \"deleteReason\", required = false) String deleteReason) {\n","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskResource.java#L120-L156","documentation":"executeTaskAction dispatches only on the known actions: claim, complete, delegate, resolve. Any other value in TaskActionRequest.action falls through to a FlowableIllegalArgumentException whose message embeds the offending action string (the bracketed message is the prefix before interpolation).","triggerScenarios":"POST /cmmn-runtime/tasks/{taskId} with {\"action\":\"finish\"}, {\"action\":\"CLAIM\"} (case-sensitive mismatch), a typo, or an action name valid only in the BPMN REST API.","commonSituations":"Case-sensitivity mistakes ('Claim' vs 'claim'); reusing action names from a different API; free-form UI input passed through without validation; new actions assumed to exist in this Flowable version.","solutions":["Use one of the supported action strings: claim, complete, delegate, resolve (all lowercase)","Normalize/validate the action client-side before sending","Check the ActionRequest constants (TaskActionRequest.ACTION_*) for the exact values supported by your Flowable version"],"exampleFix":"// before\n{\"action\":\"completeTask\"}\n// after\n{\"action\":\"complete\"}","handlingStrategy":"validation","validationCode":"const SUPPORTED_ACTIONS = ['claim','complete','delegate','resolve'];\nfunction assertValidAction(action) {\n  if (!SUPPORTED_ACTIONS.includes(action)) {\n    throw new Error(`Unsupported action '${action}'; use one of ${SUPPORTED_ACTIONS.join(', ')}`);\n  }\n}","typeGuard":"function isTaskAction(s) {\n  return ['claim','complete','delegate','resolve'].includes(s);\n}","tryCatchPattern":"try {\n  await post(`/cmmn-runtime/tasks/${taskId}`, { action });\n} catch (e) {\n  if (e.status === 400 && /Invalid action/.test(e.body.message)) {\n    throw new Error(`'${action}' is not a supported CMMN task action`);\n  }\n  throw e;\n}","preventionTips":["Normalize action strings to lowercase before sending","Reference TaskActionRequest.ACTION_* constants instead of literals in Java clients","Check the Flowable version's supported actions when upgrading (new actions are not backported)"],"tags":["rest-api","invalid-enum","task-action"],"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"}