{"record":{"id":"b9cc7ce9e0b42d0f","repo":"flowable/flowable-engine","slug":"not-both-a-taskid-and-a-processdefinitionid-parame","errorCode":null,"errorMessage":"Not both a taskId and a processDefinitionId parameter can be provided","messagePattern":"Not both a taskId and a processDefinitionId parameter can 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":73,"sourceCode":"    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);\n        }\n        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessFormData(formData);","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/form/FormDataResource.java#L55-L91","documentation":"FormDataResource.getFormData treats taskId and processDefinitionId as mutually exclusive: form data is fetched either for a task or for a process definition's start form. Supplying both query parameters simultaneously throws FlowableIllegalArgumentException to avoid ambiguous lookup.","triggerScenarios":"GET /form/form-data?taskId=X&processDefinitionId=Y — both parameters non-null in the same request, usually from a client that blindly forwards all known ids.","commonSituations":"Query-builder code that appends every available id, copies of URLs shared between the two lookup modes, or gateway/proxy layers enriching requests with extra parameters.","solutions":["Send only taskId when looking up a task's form data; drop processDefinitionId.","Send only processDefinitionId when fetching the start form; drop taskId.","Add client-side mutual-exclusion validation before building the URL.","If you need both pieces of data, issue two separate requests."],"exampleFix":"// before\nGET /form/form-data?taskId=125&processDefinitionId=oneTaskProcess:1:4\n// after\nGET /form/form-data?taskId=125","handlingStrategy":"validation","validationCode":"if (taskId != null && processDefinitionId != null) {\n    throw new IllegalArgumentException(\"Send only one of taskId or processDefinitionId\");\n}","typeGuard":null,"tryCatchPattern":"try { formData = api.getFormData(taskId, null); } catch (FlowableIllegalArgumentException e) { /* strip the redundant parameter and retry */ }","preventionTips":["Enforce mutual exclusion in query builders","Choose the lookup mode explicitly per request","Split needs for both ids into separate calls"],"tags":["flowable","rest","forms","conflicting-parameters"],"backgroundTag":"mutually-exclusive-options","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"}