public void testSimpleProcessApplicationDeployment() { // given EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication(); BpmnModelInstance model = createProcessWithServiceTask(PROCESS_KEY); ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()) .name(DEPLOYMENT_NAME) .addModelInstance(RESOURCE_NAME, model) .enableDuplicateFiltering(true) .deploy(); Resource resource1 = getResourceByName(deployment1.getId(), RESOURCE_NAME); // when ProcessApplicationDeployment deployment2 = repositoryService .createDeployment(processApplication.getReference()) .name(DEPLOYMENT_NAME) .addDeploymentResourceById(deployment1.getId(), resource1.getId()) .deploy(); // then // registration was performed: ProcessApplicationRegistration registration = deployment2.getProcessApplicationRegistration(); Set<String> deploymentIds = registration.getDeploymentIds(); assertEquals(1, deploymentIds.size()); assertTrue(deploymentIds.contains(deployment2.getId())); deleteDeployments(deployment1, deployment2); }
.name(DEPLOYMENT_NAME) .resumePreviousVersions() .addDeploymentResourceById(deployment1.getId(), resource1.getId()) .deploy();
.resumePreviousVersions() .resumePreviousVersionsBy(ResumePreviousBy.RESUME_BY_DEPLOYMENT_NAME) .addDeploymentResourceById(deployment1.getId(), resource1.getId()) .deploy();
public void testSimpleProcessApplicationDeployment() { // given EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication(); BpmnModelInstance model = createProcessWithServiceTask(PROCESS_KEY); ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()) .name(DEPLOYMENT_NAME) .addModelInstance(RESOURCE_NAME, model) .enableDuplicateFiltering(true) .deploy(); Resource resource1 = getResourceByName(deployment1.getId(), RESOURCE_NAME); // when ProcessApplicationDeployment deployment2 = repositoryService .createDeployment(processApplication.getReference()) .name(DEPLOYMENT_NAME) .addDeploymentResourceById(deployment1.getId(), resource1.getId()) .deploy(); // then // registration was performed: ProcessApplicationRegistration registration = deployment2.getProcessApplicationRegistration(); Set<String> deploymentIds = registration.getDeploymentIds(); assertEquals(1, deploymentIds.size()); assertTrue(deploymentIds.contains(deployment2.getId())); deleteDeployments(deployment1, deployment2); }
.name(DEPLOYMENT_NAME) .resumePreviousVersions() .addDeploymentResourceById(deployment1.getId(), resource1.getId()) .deploy();
.resumePreviousVersions() .resumePreviousVersionsBy(ResumePreviousBy.RESUME_BY_DEPLOYMENT_NAME) .addDeploymentResourceById(deployment1.getId(), resource1.getId()) .deploy();