Deploying DMN with BPMN using REST API

Hi!

BPMN upload to Camunda works fine using REST API:
https://docs.camunda.org/manual/latest/reference/rest/deployment/post-deployment/

Cannot find any information how to upload DMN file to Camunda.
Can we upload DMN files together with BPMN files?

Thanks!
Erki

Perhaps this sentence means more than one file is allowed to upload same time:

* 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.

i gonna try.

Yes you can upload the DMN as a additional file in the deployment.

Yes, work fine. Uploading together multiple parts. Java & Spring example:

	HttpHeaders headers = new HttpHeaders();
	headers.setContentType(MediaType.MULTIPART_FORM_DATA);
	MultiValueMap<String, Object> parts = new LinkedMultiValueMap<String, Object>();ByteArrayResource contentsAsResource = new ByteArrayResource(bpmnProcessDto.getProcessXml().getBytes("UTF-8")) {
		@Override
		public String getFilename() {
			return name + ".bpmn";
		}
	};
	parts.add("data", contentsAsResource);
	int i = 0;
	for (String xml : bpmnProcessDto.getDmnXmlList()) {
		int num = i;
		contentsAsResource = new ByteArrayResource(xml.getBytes("UTF-8")) {
			@Override
			public String getFilename() {
				return name + "decision" + num + ".dmn";
			}
		};
		parts.add("data" + i, contentsAsResource);
		i++;
	}
	parts.add("deployment-name", name);
	parts.add("enable-duplicate-filtering", true);
	parts.add("deployment-source", deploymentName);
	Map<String, Object> result = restTemplate().postForObject(url, parts, Map.class);
2 Likes