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()); }
protected internal virtual DeploymentBuilder addRedeploymentResources(DeploymentBuilder builder, RedeploymentDto redeployment) { builder.source(redeployment.Source); IList <string> resourceIds = redeployment.ResourceIds; IList <string> resourceNames = redeployment.ResourceNames; bool isResourceIdListEmpty = resourceIds == null || resourceIds.Count == 0; bool isResourceNameListEmpty = resourceNames == null || resourceNames.Count == 0; if (isResourceIdListEmpty && isResourceNameListEmpty) { builder.addDeploymentResources(deploymentId); } else { if (!isResourceIdListEmpty) { builder.addDeploymentResourcesById(deploymentId, resourceIds); } if (!isResourceNameListEmpty) { builder.addDeploymentResourcesByName(deploymentId, resourceNames); } } return(builder); }