{"record":{"id":"380e50d79597cf3d","repo":"flowable/flowable-engine","slug":"the-taskid-or-processdefinitionid-property-has-to","errorCode":null,"errorMessage":"The taskId or processDefinitionId property has to be provided","messagePattern":"The taskId or processDefinitionId property has to be provided","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/form/FormDataResource.java","lineNumber":110,"sourceCode":"        }\n\n        return restResponseFactory.createFormDataResponse(formData);\n    }\n\n    @ApiOperation(value = \"Submit task form data\", tags = { \"Forms\" })\n    @ApiResponses(value = {\n            @ApiResponse(code = 200, message = \"Indicates request was successful and the form data was submitted\"),\n            @ApiResponse(code = 204, message = \"If TaskId has been provided, Indicates request was successful and the form data was submitted. Returns empty\"),\n            @ApiResponse(code = 400, message = \"Indicates an parameter was passed in the wrong format. The status-message contains additional information.\") })\n    @PostMapping(value = \"/form/form-data\", produces = \"application/json\")\n    public ProcessInstanceResponse submitForm(@RequestBody SubmitFormRequest submitRequest, HttpServletResponse response) {\n\n        if (submitRequest == null) {\n            throw new FlowableException(\"A request body was expected when executing the form submit.\");\n        }\n\n        if (submitRequest.getTaskId() == null && submitRequest.getProcessDefinitionId() == null) {\n            throw new FlowableIllegalArgumentException(\"The taskId or processDefinitionId property has to be provided\");\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.submitFormData(submitRequest);\n        }\n\n        Map<String, String> propertyMap = new HashMap<>();\n        if (submitRequest.getProperties() != null) {\n            for (RestFormProperty formProperty : submitRequest.getProperties()) {\n                propertyMap.put(formProperty.getId(), formProperty.getValue());\n            }\n        }\n\n        if (submitRequest.getTaskId() != null) {\n            formService.submitTaskFormData(submitRequest.getTaskId(), propertyMap);\n            response.setStatus(HttpStatus.NO_CONTENT.value());\n            return null;\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/form/FormDataResource.java#L92-L128","documentation":"submitForm requires exactly one target: either a taskId (task form) or a processDefinitionId (start form). FlowableIllegalArgumentException is thrown when the parsed request body has neither property set, because there is nothing to submit the form for.","triggerScenarios":"POST /form/form-data with a JSON body that omits both taskId and processDefinitionId, e.g. {\"formProperties\":[...]} only.","commonSituations":"Client builds the payload dynamically and the id field is dropped when null; copying an example payload without filling in the id; field-name typos like processDefinitionID.","solutions":["Include taskId to submit a task form, or processDefinitionId to submit a start form","Validate the payload on the client before the POST","Catch FlowableIllegalArgumentException (HTTP 400) and prompt the user for the missing identifier"],"exampleFix":"// before\n{\"formProperties\":[{\"id\":\"approved\",\"value\":\"true\"}]}\n\n// after\n{\"taskId\":\"125\",\"formProperties\":[{\"id\":\"approved\",\"value\":\"true\"}]}","handlingStrategy":"validation","validationCode":"if (request.taskId == null && request.processDefinitionId == null) {\n  throw new Error('taskId or processDefinitionId must be provided before submitForm');\n}","typeGuard":"function hasSubmitTarget(r) { return r != null && (typeof r.taskId === 'string' || typeof r.processDefinitionId === 'string'); }","tryCatchPattern":"try { await submitForm(req); } catch (e) { if (e.status === 400 && /taskId or processDefinitionId/.test(e.message)) promptForTarget(); else throw e; }","preventionTips":["Validate request DTOs before serialization","Never drop id fields when they are null — fail fast client-side","Use typed clients that make taskId/processDefinitionId explicit"],"tags":["rest-api","flowable","validation","missing-parameter"],"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-18T11:17:12.947Z"}