flowable-engine icon indicating copy to clipboard operation
flowable-engine copied to clipboard

POST /repository/deployments deploymentKey and deploymentName params are invalid.

Open Jenyow opened this issue 2 years ago • 8 comments

In the flowable-rest-6.7.2.jar org.flowable.rest.service.api.repository.DeploymentCollectionResource. POST /repository/deployments, the method's deploymentKey and deploymentName receive values. Why use String queryString = request.getQueryString(); to get the deploymentKey and deploymentName.
The queryString is null.

Jenyow avatar Oct 16 '22 14:10 Jenyow

Please show with a failing unit test that this is not working. For now we will close the issue, please reopen it with a failing unit test when possible.

tijsrademakers avatar Oct 17 '22 06:10 tijsrademakers

Please show with a failing unit test that this is not working. For now we will close the issue, please reopen it with a failing unit test when possible.

Obviously, request.getQueryString() doesn't need to be used.

curl --location --request POST 'http://localhost:8080/process-api/repository/deployments' \
--header 'Content-Type: multipart/form-data' \
--form 'file=@"/test01.bpmn20.xml"' \
--form 'deploymentKey="key01"' \
--form 'deploymentName="name01"' \
--form 'tenantId="tenatid01"'

image

Jenyow avatar Oct 21 '22 14:10 Jenyow

Thanks for sharing this information @Jenyow. I see that you are passing the information as multi part form parameters.

We'll look into fixing this

filiphr avatar Oct 21 '22 16:10 filiphr

@filiphr if this is not assigned to anyone can I create a PR for this ?

Abhijeetmishr avatar Feb 20 '23 17:02 Abhijeetmishr

Yes @Abhijeetmishr, you can work on this. I'll assign it to you.

filiphr avatar Feb 20 '23 19:02 filiphr

@filiphr @Jenyow I think those values are coming null because of this.

****Its because when you have form enctype="multipart/form-data". You can not get other form fields by using request.getParameter("paramnName");. It will always give you NULL.

You have to use FormItem's isFormField() to check if its regular field or file.****

correct me if I am wrong @filiphr what do you suggest ?

Abhijeetmishr avatar Feb 22 '23 14:02 Abhijeetmishr

@Abhijeetmishr @PostMapping consumes is 'multipart/form-data'.
I don't know what the problem is that I upload the file using 'multipart/form-data'.

Delete the line 'request.getQueryString()' and direct use the method params, everything is going well.

Jenyow avatar Feb 22 '23 14:02 Jenyow

@filiphr @Jenyow I think those values are coming null because of this.

Its because when you have form enctype="multipart/form-data". You can not get other form fields by using request.getParameter("paramnName");. It will always give you NULL. You have to use FormItem's isFormField() to check if its regular field or file.

correct me if I am wrong @filiphr what do you suggest ?

@filiphr any suggestion/comment on this ?

Abhijeetmishr avatar Mar 06 '23 13:03 Abhijeetmishr