use of org.camunda.bpm.application.ProcessApplicationRegistration in project camunda-bpm-platform by camunda.
the class DeploymentAuthorizationTest method testRegisterProcessApplicationAsCamundaAdmin.
public void testRegisterProcessApplicationAsCamundaAdmin() {
// given
identityService.setAuthentication(userId, Collections.singletonList(Groups.CAMUNDA_ADMIN));
EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
ProcessApplicationReference reference = processApplication.getReference();
String deploymentId = createDeployment(null, FIRST_RESOURCE).getId();
// when
ProcessApplicationRegistration registration = managementService.registerProcessApplication(deploymentId, reference);
// then
assertNotNull(registration);
assertNotNull(getProcessApplicationForDeployment(deploymentId));
deleteDeployment(deploymentId);
}
use of org.camunda.bpm.application.ProcessApplicationRegistration in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testProcessApplicationDeploymentNoResume.
public void testProcessApplicationDeploymentNoResume() {
// create initial deployment
ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()).name("deployment").addClasspathResource("org/camunda/bpm/engine/test/api/repository/version1.bpmn20.xml").deploy();
assertThatOneProcessIsDeployed();
// deploy update with changes:
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name("deployment").enableDuplicateFiltering(false).addClasspathResource("org/camunda/bpm/engine/test/api/repository/version2.bpmn20.xml").deploy();
List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().orderByProcessDefinitionVersion().asc().list();
// now there are 2 process definitions deployed
assertEquals(1, processDefinitions.get(0).getVersion());
assertEquals(2, processDefinitions.get(1).getVersion());
// old deployment was NOT resumed
ProcessApplicationRegistration registration = deployment2.getProcessApplicationRegistration();
Set<String> deploymentIds = registration.getDeploymentIds();
assertEquals(1, deploymentIds.size());
assertEquals(processEngine.getName(), registration.getProcessEngineName());
deleteDeployments(deployment1, deployment2);
}
use of org.camunda.bpm.application.ProcessApplicationRegistration in project camunda-bpm-platform by camunda.
the class RedeploymentTest method testRedeployProcessApplicationDeploymentResumePreviousVersions.
public void testRedeployProcessApplicationDeploymentResumePreviousVersions() {
// given
EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
// first deployment
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);
// second deployment
model = createProcessWithUserTask(PROCESS_KEY);
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name(DEPLOYMENT_NAME).addModelInstance(RESOURCE_NAME, model).enableDuplicateFiltering(true).deploy();
// when
ProcessApplicationDeployment deployment3 = repositoryService.createDeployment(processApplication.getReference()).name(DEPLOYMENT_NAME).resumePreviousVersions().addDeploymentResourceById(deployment1.getId(), resource1.getId()).deploy();
// then
// old deployments was resumed
ProcessApplicationRegistration registration = deployment3.getProcessApplicationRegistration();
Set<String> deploymentIds = registration.getDeploymentIds();
assertEquals(3, deploymentIds.size());
deleteDeployments(deployment1, deployment2, deployment3);
}
use of org.camunda.bpm.application.ProcessApplicationRegistration in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testPartialChangesResumePreviousVersion.
public void testPartialChangesResumePreviousVersion() {
BpmnModelInstance model1 = Bpmn.createExecutableProcess("process1").done();
BpmnModelInstance model2 = Bpmn.createExecutableProcess("process2").done();
// create initial deployment
ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()).name("deployment").addModelInstance("process1.bpmn20.xml", model1).deploy();
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name("deployment").enableDuplicateFiltering(true).resumePreviousVersions().addModelInstance("process1.bpmn20.xml", model1).addModelInstance("process2.bpmn20.xml", model2).deploy();
ProcessApplicationRegistration registration = deployment2.getProcessApplicationRegistration();
assertEquals(2, registration.getDeploymentIds().size());
deleteDeployments(deployment1, deployment2);
}
use of org.camunda.bpm.application.ProcessApplicationRegistration in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testProcessApplicationDeploymentResumePreviousVersionsByDeploymentName.
public void testProcessApplicationDeploymentResumePreviousVersionsByDeploymentName() {
// create initial deployment
ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()).name("deployment").addClasspathResource("org/camunda/bpm/engine/test/api/repository/version1.bpmn20.xml").deploy();
assertThatOneProcessIsDeployed();
// deploy update with changes:
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name("deployment").enableDuplicateFiltering(false).resumePreviousVersions().resumePreviousVersionsBy(ResumePreviousBy.RESUME_BY_DEPLOYMENT_NAME).addClasspathResource("org/camunda/bpm/engine/test/api/repository/version2.bpmn20.xml").deploy();
List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().orderByProcessDefinitionVersion().asc().list();
// now there are 2 process definitions deployed
assertEquals(1, processDefinitions.get(0).getVersion());
assertEquals(2, processDefinitions.get(1).getVersion());
// old deployment was resumed
ProcessApplicationRegistration registration = deployment2.getProcessApplicationRegistration();
Set<String> deploymentIds = registration.getDeploymentIds();
assertEquals(2, deploymentIds.size());
assertEquals(processEngine.getName(), registration.getProcessEngineName());
deleteDeployments(deployment1, deployment2);
}
Aggregations