{"record":{"id":"fcfcfa2ed80d3497","repo":"flowable/flowable-engine","slug":"illegal-action-request-getaction-fcfcfa","errorCode":null,"errorMessage":"Illegal action: '\" + request.getAction() + \"'.","messagePattern":"Illegal action: '\" \\+ request\\.getAction\\(\\) \\+ \"'\\.","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceCollectionResource.java","lineNumber":315,"sourceCode":"    }\n\n    @ApiOperation(value = \"Post action request to delete a bulk of historic process instances\", tags = {\n            \"Manage History Process Instances\" }, nickname = \"bulkDeleteHistoricProcessInstances\", code = 204)\n    @ApiResponses(value = {\n            @ApiResponse(code = 204, message = \"Indicates the bulk of historic process instances was found and deleted. Response body is left empty intentionally.\"),\n            @ApiResponse(code = 404, message = \"Indicates at least one requested process instance was not found.\")\n    })\n    @PostMapping(value = \"/history/historic-process-instances/delete\")\n    @ResponseStatus(value = HttpStatus.NO_CONTENT)\n    public void bulkDeleteHistoricProcessInstances(@ApiParam(name = \"bulkDeleteRestActionRequest\")\n    @RequestBody BulkDeleteInstancesRestActionRequest request) {\n        if (BulkDeleteInstancesRestActionRequest.DELETE_ACTION.equals(request.getAction())) {\n            if (restApiInterceptor != null) {\n                restApiInterceptor.bulkDeleteHistoricProcessInstances(request.getInstanceIds());\n            }\n            historyService.bulkDeleteHistoricProcessInstances(request.getInstanceIds());\n        } else {\n            throw new FlowableIllegalArgumentException(\"Illegal action: '\" + request.getAction() + \"'.\");\n        }\n    }\n}\n","sourceCodeStart":297,"sourceCodeEnd":319,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricProcessInstanceCollectionResource.java#L297-L319","documentation":"Bulk deletion of historic process instances accepts an action envelope; only the action string \"delete\" (BulkDeleteInstancesRestActionRequest.DELETE_ACTION) is valid. Any other action value causes FlowableIllegalArgumentException listing the received action.","triggerScenarios":"POST to the historic process instance bulk-delete collection endpoint with a body whose action field is not exactly \"delete\" (null, typo, different verb).","commonSituations":"Generic delete UIs sending action names like \"remove\" or \"purge\"; null action omitted from the JSON body; API drift after upgrading Flowable REST versions.","solutions":["Set the request body action to \"delete\" exactly","Ensure the action field is present and non-null in the JSON payload","Confirm instanceIds are also provided since the interceptor and historyService require them"],"exampleFix":"// before\n{\"action\":\"remove\",\"instanceIds\":[\"p1\",\"p2\"]}\n// after\n{\"action\":\"delete\",\"instanceIds\":[\"p1\",\"p2\"]}","handlingStrategy":"validation","validationCode":"if (req.action !== 'delete') throw new Error('bulk action must be \"delete\"');","typeGuard":"const isDeleteAction = (a) => a === 'delete';","tryCatchPattern":"catch (e) { if (e.response && e.response.status === 400 && /Illegal action/.test(e.response.data.message)) { /* correct action field and retry */ } throw e; }","preventionTips":["Use the generated request model (BulkDeleteInstancesRestActionRequest) instead of hand-built JSON","Assert action === 'delete' before sending","Keep instanceIds non-empty alongside the action"],"tags":["rest-api","invalid-enum-value","bulk-delete","validation"],"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-14T11:17:12.474Z"}