{"record":{"id":"474be8af402f022a","repo":"flowable/flowable-engine","slug":"the-taskid-or-processdefinitionid-parameter-has-to","errorCode":null,"errorMessage":"The taskId or processDefinitionId parameter has to be provided","messagePattern":"The taskId or processDefinitionId parameter 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":69,"sourceCode":"    @Autowired\n    protected RestResponseFactory restResponseFactory;\n\n    @Autowired\n    protected FormService formService;\n    \n    @Autowired(required=false)\n    protected BpmnRestApiInterceptor restApiInterceptor;\n\n    @ApiOperation(value = \"Get form data\", tags = { \"Forms\" }, notes = \"\")\n    @ApiResponses(value = {\n            @ApiResponse(code = 200, message = \"Indicates that form data could be queried.\"),\n            @ApiResponse(code = 404, message = \"Indicates that form data could not be found.\") })\n    @GetMapping(value = \"/form/form-data\", produces = \"application/json\")\n    public FormDataResponse getFormData(@RequestParam(value = \"taskId\", required = false) String taskId,\n            @RequestParam(value = \"processDefinitionId\", required = false) String processDefinitionId) {\n\n        if (taskId == null && processDefinitionId == null) {\n            throw new FlowableIllegalArgumentException(\"The taskId or processDefinitionId parameter has to be provided\");\n        }\n\n        if (taskId != null && processDefinitionId != null) {\n            throw new FlowableIllegalArgumentException(\"Not both a taskId and a processDefinitionId parameter can be provided\");\n        }\n\n        FormData formData = null;\n        String id = null;\n        if (taskId != null) {\n            formData = formService.getTaskFormData(taskId);\n            id = taskId;\n        } else {\n            formData = formService.getStartFormData(processDefinitionId);\n            id = processDefinitionId;\n        }\n\n        if (formData == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find a form data with id '\" + id + \"'.\", FormData.class);","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/form/FormDataResource.java#L51-L87","documentation":"FormDataResource.getFormData exposes GET /form/form-data and requires exactly one lookup key: either taskId or processDefinitionId. When neither query parameter is supplied, FlowableIllegalArgumentException is thrown because there is nothing to fetch form data for.","triggerScenarios":"GET /form/form-data with no query parameters at all, or with both parameters absent due to a client bug (e.g. null/empty values dropped before the request).","commonSituations":"Hand-built REST URLs missing the query string, templated client calls where variables were not interpolated, or API explorers sending the path without params.","solutions":["Add exactly one of ?taskId=<id> or ?processDefinitionId=<id> to the request.","Resolve the id client-side first (query tasks or process definitions) before calling the endpoint.","If both are available, pick the taskId path — sending both raises the companion error (index 3419).","Validate parameters in client code before issuing the request."],"exampleFix":"// before\nGET /flowable-rest/service/form/form-data\n// after\nGET /flowable-rest/service/form/form-data?taskId=125","handlingStrategy":"validation","validationCode":"if (taskId == null && processDefinitionId == null) {\n    throw new IllegalArgumentException(\"Provide taskId or processDefinitionId\");\n}","typeGuard":null,"tryCatchPattern":"try { formData = api.getFormData(taskId, null); } catch (FlowableIllegalArgumentException e) { /* check request params */ }","preventionTips":["Validate that exactly one lookup id is set before calling","Interpolate query parameters in client templates","Resolve ids via task/process definition queries first"],"tags":["flowable","rest","forms","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"}