示例#1
0
        protected internal virtual DeploymentWithDefinitions tryToRedeploy(RedeploymentDto redeployment)
        {
            RepositoryService repositoryService = ProcessEngine.RepositoryService;

            DeploymentBuilder builder = repositoryService.createDeployment();

            builder.nameFromDeployment(deploymentId);

            string tenantId = Deployment.TenantId;

            if (!string.ReferenceEquals(tenantId, null))
            {
                builder.tenantId(tenantId);
            }

            if (redeployment != null)
            {
                builder = addRedeploymentResources(builder, redeployment);
            }
            else
            {
                builder.addDeploymentResources(deploymentId);
            }

            return(builder.deployWithResult());
        }
示例#2
0
        public virtual DeploymentWithDefinitions deploy(DeploymentBuilder deploymentBuilder)
        {
            DeploymentWithDefinitions deployment = deploymentBuilder.deployWithResult();

            processEngineRule.manageDeployment(deployment);

            return(deployment);
        }
示例#3
0
        public virtual DeploymentWithDefinitionsDto createDeployment(UriInfo uriInfo, MultipartFormData payload)
        {
            DeploymentBuilder deploymentBuilder = extractDeploymentInformation(payload);

            if (deploymentBuilder.ResourceNames.Count > 0)
            {
                DeploymentWithDefinitions deployment = deploymentBuilder.deployWithResult();

                DeploymentWithDefinitionsDto deploymentDto = DeploymentWithDefinitionsDto.fromDeployment(deployment);


                URI uri = uriInfo.BaseUriBuilder.path(relativeRootResourcePath).path(org.camunda.bpm.engine.rest.DeploymentRestService_Fields.PATH).path(deployment.Id).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.");
            }
        }