use of org.camunda.bpm.engine.rest.dto.repository.DeploymentWithDefinitionsDto in project camunda-bpm-platform by camunda.
the class DeploymentRestServiceImpl method createDeployment.
public DeploymentWithDefinitionsDto createDeployment(UriInfo uriInfo, MultipartFormData payload) {
DeploymentBuilder deploymentBuilder = extractDeploymentInformation(payload);
if (!deploymentBuilder.getResourceNames().isEmpty()) {
DeploymentWithDefinitions deployment = deploymentBuilder.deployWithResult();
DeploymentWithDefinitionsDto deploymentDto = DeploymentWithDefinitionsDto.fromDeployment(deployment);
URI uri = uriInfo.getBaseUriBuilder().path(relativeRootResourcePath).path(DeploymentRestService.PATH).path(deployment.getId()).build();
// GET
deploymentDto.addReflexiveLink(uri, HttpMethod.GET, "self");
return deploymentDto;
} else {
throw new InvalidRequestException(Status.BAD_REQUEST, "No deployment resources contained in the form upload.");
}
}
use of org.camunda.bpm.engine.rest.dto.repository.DeploymentWithDefinitionsDto in project camunda-bpm-platform by camunda.
the class DeploymentResourceImpl method redeploy.
public DeploymentDto redeploy(UriInfo uriInfo, RedeploymentDto redeployment) {
DeploymentWithDefinitions deployment = null;
try {
deployment = tryToRedeploy(redeployment);
} catch (NotFoundException e) {
throw createInvalidRequestException("redeploy", Status.NOT_FOUND, e);
} catch (NotValidException e) {
throw createInvalidRequestException("redeploy", Status.BAD_REQUEST, e);
}
DeploymentWithDefinitionsDto deploymentDto = DeploymentWithDefinitionsDto.fromDeployment(deployment);
URI uri = uriInfo.getBaseUriBuilder().path(relativeRootResourcePath).path(DeploymentRestService.PATH).path(deployment.getId()).build();
// GET /
deploymentDto.addReflexiveLink(uri, HttpMethod.GET, "self");
return deploymentDto;
}
Aggregations