{"record":{"id":"ec53e3720b2b493b","repo":"flowable/flowable-engine","slug":"taskids-can-not-be-null-for-bulk-update-tasks-requ","errorCode":null,"errorMessage":"taskIds can not be null for bulk update tasks requests","messagePattern":"taskIds can not be null for bulk update tasks requests","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskCollectionResource.java","lineNumber":393,"sourceCode":"        \n        taskService.saveTask(task);\n\n        return restResponseFactory.createTaskResponse(task);\n    }\n\n    @ApiOperation(value = \"Update Tasks\", tags = { \"Tasks\" })\n    @ApiResponses(value = {\n            @ApiResponse(code = 201, message = \"Indicates request was successful and the tasks are returned\"),\n            @ApiResponse(code = 400, message = \"Indicates a parameter was passed in the wrong format or that delegationState has an invalid value (other than pending and resolved). The status-message contains additional information.\")\n    })\n    @PutMapping(value = \"/cmmn-runtime/tasks\", produces = \"application/json\")\n    public DataResponse<TaskResponse> bulkUpdateTasks(@RequestBody BulkTasksRequest bulkTasksRequest) {\n\n        if (bulkTasksRequest == null) {\n            throw new FlowableException(\"A request body was expected when bulk updating tasks.\");\n        }\n        if (bulkTasksRequest.getTaskIds() == null) {\n            throw new FlowableIllegalArgumentException(\"taskIds can not be null for bulk update tasks requests\");\n        }\n\n        Collection<Task> taskList = getTasksFromRequest(bulkTasksRequest.getTaskIds());\n\n        if (taskList.size() != bulkTasksRequest.getTaskIds().size()) {\n            taskList.stream().forEach(task -> bulkTasksRequest.getTaskIds().remove(task.getId()));\n            throw new FlowableObjectNotFoundException(\n                    \"Could not find task instance with id:\" + bulkTasksRequest.getTaskIds().stream().collect(Collectors.joining(\",\")));\n        }\n\n        // Populate the task properties based on the request\n        populateTasksFromRequest(taskList, bulkTasksRequest);\n\n        if (restApiInterceptor != null) {\n            restApiInterceptor.bulkUpdateTasks(taskList, bulkTasksRequest);\n        }\n\n        // Save the task and fetch again, it's possible that an","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskCollectionResource.java#L375-L411","documentation":"Within bulkUpdateTasks, a non-null BulkTasksRequest must carry a taskIds collection. If getTaskIds() returns null, the request cannot identify any tasks and FlowableIllegalArgumentException is thrown.","triggerScenarios":"PUT /cmmn-runtime/tasks with a JSON body that omits the taskIds field or explicitly sets it to null.","commonSituations":"Clients sending only the property-update fields and forgetting taskIds; JSON field name mismatch (taskId vs taskIds); null after partial deserialization.","solutions":["Include a non-null taskIds array in the BulkTasksRequest body","Check the JSON field name is exactly taskIds","Validate the body client-side before issuing the PUT","Handle 400 (FlowableIllegalArgumentException maps to bad request) by fixing the payload"],"exampleFix":"// before\n{\"assignee\":\"kermit\"}\n// after\n{\"taskIds\":[\"t1\",\"t2\"],\"assignee\":\"kermit\"}","handlingStrategy":"validation","validationCode":"if (!Array.isArray(body.taskIds) || body.taskIds.length === 0) throw new Error('taskIds is required for bulk update');","typeGuard":"const hasTaskIds = (b) => b != null && Array.isArray(b.taskIds) && b.taskIds.length > 0;","tryCatchPattern":"try { await bulkUpdate(body); } catch (e) { if (e.message.includes('taskIds can not be null')) { /* correct payload then retry */ } throw e; }","preventionTips":["Include taskIds in every BulkTasksRequest","Validate body shape against BulkTasksRequest before PUT","Watch for field-name typos like taskId vs taskIds"],"tags":["rest","http","validation","missing-field"],"backgroundTag":"missing-required-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}