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 /deployment/create

Parameters

Request Body

A multipart form submit with the following parts:

Form Part Name Content Type Description
deployment-name text/plain The name for the deployment to be created.
enable-duplicate-filtering text/plain 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 resouces already exists and if true, not create a new deployment but instead return the existing deployment. The default value is false.
deploy-changed-only text/plain 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 text/plain The source for the deployment to be created.
deployment-activation-time text/plain 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.
tenant-id text/plain The tenant id for the deployment to be created.
* application/octet-stream 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 Value 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 /deployment/create

--28319d96a8c54b529aa9159ad75edef9
Content-Disposition: form-data; name="deployment-name"

aName
--28319d96a8c54b529aa9159ad75edef9
Content-Disposition: form-data; name="enable-duplicate-filtering"

true
--28319d96a8c54b529aa9159ad75edef9
Content-Disposition: form-data; name="deployment-source"

process application
--28319d96a8c54b529aa9159ad75edef9
Content-Disposition: form-data; name="deployment-activation-time"

2030-11-11T11:11:11.000+0200
--28319d96a8c54b529aa9159ad75edef9
Content-Disposition: form-data; name="data"; filename="test.bpmn"

<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions ...>
  <!-- BPMN 2.0 XML omitted -->
</bpmn2:definitions>
--28319d96a8c54b529aa9159ad75edef9--

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.

{
    "type": "ParseException",
    "message": "ENGINE-09005 Could not parse BPMN process. Errors: Exclusive Gateway 'ExclusiveGateway_1' has outgoing sequence flow 'SequenceFlow_0' without condition which is not the default flow.",
    "details": {
        "invoice.bpmn": {
            "errors": [
                {
                    "message": "Exclusive Gateway 'ExclusiveGateway_1' has outgoing sequence flow 'SequenceFlow_0' without condition which is not the default flow.",
                    "line": 77,
                    "column": 15,
                    "mainBpmnElementId": "ExclusiveGateway_1",
                    "bpmnElementIds": [
                        "ExclusiveGateway_1",
                        "SequenceFlow_0"
                    ]
                }
            ],
            "warnings": [
                {
                    "message": "It is not recommended to use a cancelling boundary timer event with a time cycle.",
                    "line": 87,
                    "column": 20,
                    "mainBpmnElementId": "BoundaryEvent_1",
                    "bpmnElementIds": [
                        "BoundaryEvent_1"
                    ]
                }
            ]
        }
    }

目录: