Camunda Redeployment via Rest API

Hello Team,

Thanks in advance, if someone is ready answer my below queries.

  1. Can a BPMN be updated without a migration needed? assume if there is miner change in the BPMN file, so same file will be updated without creating any new deployment_id and any migrations

  2. Does Camunda have an API endpoint to update a form only without deploying a BPMN? but the Camunda Form should be associated with deployed existing BPMN file.

Thanks & Regards,
Prakash R

Hi,

  1. For transparency and resilience, any update (i.e., deployment) will create a new version. The API does not allow changing an already existing version. However, it is rather simple to migrate versions if the changes to the process are minor (i.e., elements are mapped to their counterpart in the new version).
  2. Yes. You can bind a user task to the latest version of a form. Whenever a new version is deployed, the process will use that new version. Deploying a new version of a form can be done via API (see Camunda Platform REST API). Content is provided as multipart/form-data.

Regards,
Stephan

Hi Stephan,

Thanks a lot for your quick response and solutions. Let me try with your suggestions and came back to you if need any further assistance. Thanks once again.

Thanks & Regards,
Prakash R.

Hello Stephen,

I have followed below steps, but getting 400 bad request “multipart/form-data cannot be processed”. Do you have any suggestion on this.

  1. Authorization enabled with basic auth : demo/demo
  2. In Headers defined Content-Type as “multipart/form-data”
  3. In body, passed below parameters
    {
    “id”: “3adwc87f-035d-11re-b094-0242ac1122302”,
    “tenantId”:“nexa”
    }
  4. URL format : http://127.0.0.1:8080/engine-rest/deployment/create

Thanks & Regards,
Prakash R.

Hi,

The body of a multipart/form-data looks a little bit different:

------WebKitFormBoundary2OH97Ym015CxDDmk
Content-Disposition: form-data; name="deployment-name"

form_1
------WebKitFormBoundary2OH97Ym015CxDDmk
Content-Disposition: form-data; name="deployment-source"

Camunda Modeler
------WebKitFormBoundary2OH97Ym015CxDDmk
Content-Disposition: form-data; name="enable-duplicate-filtering"

true
------WebKitFormBoundary2OH97Ym015CxDDmk
Content-Disposition: form-data; name="form_1.form"; filename="form_1.form"
Content-Type: text/xml

{
  "type": "default",
  "id": "Form_0bxbo6x",
  "exporter": {
    "name": "Camunda Modeler",
    "version": "5.11.0"
  },
  "components": [],
  "executionPlatform": "Camunda Platform",
  "executionPlatformVersion": "7.19.0"
}

------WebKitFormBoundary2OH97Ym015CxDDmk--

Let’s break it down:

  1. We define the name of the deployment (here form_1):
------WebKitFormBoundary2OH97Ym015CxDDmk
Content-Disposition: form-data; name="deployment-name"

form_1
  1. We define who is making the deployment (here My client)
------WebKitFormBoundary2OH97Ym015CxDDmk
Content-Disposition: form-data; name="deployment-source"

My client
  1. Finally, we provide the form
------WebKitFormBoundary2OH97Ym015CxDDmk
Content-Disposition: form-data; name="form_1.form"; filename="form_1.form"
Content-Type: text/xml

{
  "type": "default",
  "id": "Form_0bxbo6x",
  "exporter": {
    "name": "Camunda Modeler",
    "version": "5.11.0"
  },
  "components": [],
  "executionPlatform": "Camunda Platform",
  "executionPlatformVersion": "7.19.0"
}

------WebKitFormBoundary2OH97Ym015CxDDmk--

Hi Stephen,

Thanks for sharing the steps.

I have passed below parameters, except form json content. but still getting “multipart/form-data cannot be processed” error.

In Headers, Content-Type specified as “multipart/form-data”

Am I missed anything at config level.

Thanks & Regards,
Prakash R.

Hi,

filename is actually part of the file and not a separate part in the form field. As a key put the name of the file, as the value select the file:

Hi Stephan,

Thanks for you suggestion.

Yes, I was did the same. but issues persists. Am I missed anything?

Thanks & Regards,
Prakash R.

What setup are you using? Camunda Run? Embedded Engine with Spring Boot?

Hi Stephan,

I am executing Rest API call via Postman and validated from Camunda Modular.

Currently using Camunda Run

Thanks & Regards,
Prakash R.

Hi Stephan,

Thanks for you quick response and valuable suggestions.

I got the solution, after removed "multipart/form-data” from header, it’s working fine. I can able to upload the Camunda Form and able to view in Camunda Modular.

But my problem here is, it’s created with new deployment instead of appending with existing uploaded BPMN file.

My scenario here is,
I have uploaded BPMN file, later I want to upload and associate the Camunda Form in existing uploaded PBMN file. Is this scenario is possible in Camunda? because I could see for every deployment\create new deployment_id is generating. instead of creating new deployment can I able to link Camunda Form into existing deployment.

Thanks & Regards,
Prakash R.

Hi Prakash,
Great that you found a solution!
No, you cannot update an existing deployment via API.

Hi Stephan,

Thanks for your response. Ohh ok, got it. Thanks again.