Post Deployment

Creates a deployment.

Security Consideration

Deployments can contain custom code in form of scripts or EL expressions to customize process behavior. This may be abused for remote execution of arbitrary code. See the section on security considerations for custom code in the user guide for details.

Method

POST /enhancement/deployment/create

Parameters

Request Body

A multipart form submit with the following parts:

Form Part Name Content Type Description
deployment-name form-data The name for the deployment to be created.
enable-duplicate-filtering form-data A flag indicating whether the process engine should perform duplicate checking for the deployment or not. This allows you to check if a deployment with the same name and the same resources already exists and if true, not create a new deployment but instead return the existing deployment. The default value is false.
deploy-changed-only form-data A flag indicating whether the process engine should perform duplicate checking on a per-resource basis. If set to true, only those resources that have actually changed are deployed. Checks are made against resources included previous deployments of the same name and only against the latest versions of those resources. If set to true, the option enable-duplicate-filtering is overridden and set to true.
deployment-source form-data The source for the deployment to be created.
deployment-activation-time form-data Sets the date on which the process definitions contained in this deployment will be activated. This means that all process definitions will be deployed as usual, but they will be suspended from the start until the given activation date. By default*, the date must have the format yyyy-MM-dd'T'HH:mm:ss.SSSZ, e.g., 2013-01-23T14:42:45.000+0200.
tenantId form-data The tenant id for the deployment to be created.
files form-data/File The binary data to create the deployment resource. It is possible to have more than one form part with different form part names for the binary data to create a deployment.

* For further information, please see the documentation.

Result

A JSON object corresponding to the DeploymentWithDefinitions interface in the engine. Its properties are as follows:

Name Type Description
links List Link to the newly created deployment with method, href and rel.
id String The id of the deployment.
name String The name of the deployment.
source String The source of the deployment.
tenantId String The tenant id of the deployment.
deploymentTime String The time when the deployment was created.
deployedProcessDefinitions Object A JSON Object containing a property for each of the process definitions, which are successfully deployed with that deployment. The key is the process definition id, the value is a JSON Object corresponding to the process definition, which is defined in the Process Definition resource.
deployedCaseDefinitions Object A JSON Object containing a property for each of the case definitions, which are successfully deployed with that deployment. The key is the case definition id, the value is a JSON Object corresponding to the case definition, which is defined in the Case Definition resource.
deployedDecisionDefinitions Object A JSON Object containing a property for each of the decision definitions, which are successfully deployed with that deployment. The key is the decision definition id, the value is a JSON Object corresponding to the decision definition, which is defined in the Decision Definition resource.
deployedDecisionRequirementsDefinitions Object A JSON Object containing a property for each of the decision requirements definitions, which are successfully deployed with that deployment. The key is the decision requirements definition id, the value is a JSON Object corresponding to the decision requirements definition, which is defined in the Decision Requirements Definition resource.

Response Codes

Code Media type Description
200 application/json Request successful.
400 application/json In case one of the bpmn resources cannot be parsed. See the Introduction for the error response format.

Example

Request

Post data for a new deployment:

POST /enhancement/deployment/create/create

curl --location 'http://127.0.0.1:8010/enhancement/deployment/create' \
--header 'Authorization: Basic DNEJDNEJEEQWW' \
--form 'files=@"xxx/yyy/test.bpmn"' \
--form 'deployment-name="contactus-1699176038385"' \
--form 'deployment-source="Camunda Modeler"' \
--form 'enable-duplicate-filtering="true"'

Response

Status 200.

{
    "links": [
        {
            "method": "GET",
            "href": "http://localhost:38080/rest-test/deployment/aDeploymentId",
            "rel": "self"
        }
    ],
    "id": "aDeploymentId",
    "name": "aName",
    "source": "process application",
    "deploymentTime": "2013-01-23T13:59:43.000+0200",
    "tenantId": null,
    "deployedProcessDefinitions": {
        "aProcDefId": {
            "id": "aProcDefId",
            "key": "aKey",
            "category": "aCategory",
            "description": "aDescription",
            "name": "aName",
            "version": 42,
            "resource": "aResourceName",
            "deploymentId": "aDeploymentId",
            "diagram": "aResourceName.png",
            "suspended": true,
            "tenantId": null,
            "versionTag": null
        }
    },
    "deployedCaseDefinitions": null,
    "deployedDecisionDefinitions": null,
    "deployedDecisionRequirementsDefinitions": null
}

Response on Parse Errors

Status 400.

{
    "links": [],
    "id": "f27712eb-7dd5-11ee-8742-4674ac8809d4",
    "name": "contactus-1699176038385",
    "source": "Camunda Modeler",
    "deploymentTime": "2023-11-08T01:27:14.438+00:00",
    "tenantId": null,
    "deployedProcessDefinitions": {
        "Process_0blq69r:13:f288780d-7dd5-11ee-8742-4674ac8809d4": {
            "id": "Process_0blq69r:13:f288780d-7dd5-11ee-8742-4674ac8809d4",
            "key": "Process_0blq69r",
            "category": "http://bpmn.io/schema/bpmn",
            "description": null,
            "name": null,
            "version": 13,
            "resource": "diagram.bpmn",
            "deploymentId": "f27712eb-7dd5-11ee-8742-4674ac8809d4",
            "diagram": null,
            "suspended": false,
            "tenantId": null,
            "versionTag": null,
            "historyTimeToLive": null,
            "startableInTasklist": true
        }
    },
    "deployedCaseDefinitions": null,
    "deployedDecisionDefinitions": null,
    "deployedDecisionRequirementsDefinitions": null
}

On this Page: