}
return deployments;
}
public DeploymentDto createDeployment(UriInfo uriInfo, MultipartFormData payload) {
DeploymentBuilder deploymentBuilder = getProcessEngine().getRepositoryService().createDeployment();
Set<String> partNames = payload.getPartNames();
for (String name : partNames) {
FormPart part = payload.getNamedPart(name);
if (!RESERVED_KEYWORDS.contains(name)) {
deploymentBuilder.addInputStream(part.getFileName(), new ByteArrayInputStream(part.getBinaryContent()));
}
}
if (payload.getNamedPart(DEPLOYMENT_NAME) != null) {
FormPart part = payload.getNamedPart(DEPLOYMENT_NAME);
deploymentBuilder.name(part.getTextContent());
}
boolean enableDuplicateFiltering = false;
boolean deployChangedOnly = false;
if (payload.getNamedPart(ENABLE_DUPLICATE_FILTERING) != null) {
FormPart part = payload.getNamedPart(ENABLE_DUPLICATE_FILTERING);
enableDuplicateFiltering = Boolean.parseBoolean(part.getTextContent());
}
if (payload.getNamedPart(DEPLOY_CHANGED_ONLY) != null) {
FormPart part = payload.getNamedPart(DEPLOY_CHANGED_ONLY);
deployChangedOnly = Boolean.parseBoolean(part.getTextContent());
}
// deployChangedOnly overrides the enableDuplicateFiltering setting
if (deployChangedOnly) {
deploymentBuilder.enableDuplicateFiltering(true);
} else if (enableDuplicateFiltering) {
deploymentBuilder.enableDuplicateFiltering(false);
}
if(!deploymentBuilder.getResourceNames().isEmpty()) {
Deployment deployment = deploymentBuilder.deploy();
DeploymentDto deploymentDto = DeploymentDto.fromDeployment(deployment);
URI uri = uriInfo.getBaseUriBuilder()
.path(relativeRootResourcePath)