use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testSimpleProcessApplicationDeployment.
public void testSimpleProcessApplicationDeployment() {
ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.getReference()).addClasspathResource("org/camunda/bpm/engine/test/api/repository/version1.bpmn20.xml").deploy();
// process is deployed:
assertThatOneProcessIsDeployed();
// registration was performed:
ProcessApplicationRegistration registration = deployment.getProcessApplicationRegistration();
Set<String> deploymentIds = registration.getDeploymentIds();
assertEquals(1, deploymentIds.size());
assertEquals(processEngine.getName(), registration.getProcessEngineName());
deleteDeployments(deployment);
}
use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testProcessApplicationDeploymentResumePreviousVersionsByDeploymentNameNoResume.
public void testProcessApplicationDeploymentResumePreviousVersionsByDeploymentNameNoResume() {
BpmnModelInstance process1 = Bpmn.createExecutableProcess("process1").done();
ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.getReference()).name("deployment").addModelInstance("process1.bpmn", process1).deploy();
assertThatOneProcessIsDeployed();
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name("anotherDeployment").resumePreviousVersions().resumePreviousVersionsBy(ResumePreviousBy.RESUME_BY_DEPLOYMENT_NAME).addModelInstance("process2.bpmn", process1).deploy();
List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().orderByProcessDefinitionVersion().asc().list();
// there is a new version of the process
assertEquals(1, processDefinitions.get(0).getVersion());
assertEquals(2, processDefinitions.get(1).getVersion());
// but the old deployment was not resumed
ProcessApplicationRegistration registration = deployment2.getProcessApplicationRegistration();
Set<String> deploymentIds = registration.getDeploymentIds();
assertEquals(1, deploymentIds.size());
assertEquals(deployment2.getId(), deploymentIds.iterator().next());
assertEquals(processEngine.getName(), registration.getProcessEngineName());
deleteDeployments(deployment, deployment2);
}
use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testProcessApplicationDeploymentResumePreviousVersionsDifferentKeys.
public void testProcessApplicationDeploymentResumePreviousVersionsDifferentKeys() {
// 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").resumePreviousVersions().addClasspathResource("org/camunda/bpm/engine/test/api/oneTaskProcess.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(1, processDefinitions.get(1).getVersion());
// and the old deployment was not resumed
ProcessApplicationRegistration registration = deployment2.getProcessApplicationRegistration();
Set<String> deploymentIds = registration.getDeploymentIds();
assertEquals(1, deploymentIds.size());
assertEquals(deployment2.getId(), deploymentIds.iterator().next());
assertEquals(processEngine.getName(), registration.getProcessEngineName());
deleteDeployments(deployment1, deployment2);
}
use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.
the class ProcessApplicationDeploymentTest method testNullAndProcessApplicationDeploymentSourceAwareDuplicateFilter.
public void testNullAndProcessApplicationDeploymentSourceAwareDuplicateFilter() {
// given
String key = "process";
String name = "my-deployment";
BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().processDefinitionKey(key);
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery().deploymentName(name);
// when
ProcessApplicationDeployment deployment1 = repositoryService.createDeployment(processApplication.getReference()).name(name).source(null).addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
assertEquals(1, processDefinitionQuery.count());
assertEquals(1, deploymentQuery.count());
ProcessApplicationDeployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name(name).addModelInstance("process.bpmn", model).enableDuplicateFiltering(true).deploy();
// then
assertEquals(1, processDefinitionQuery.count());
assertEquals(1, deploymentQuery.count());
deleteDeployments(deployment1, deployment2);
}
use of org.camunda.bpm.engine.repository.ProcessApplicationDeployment in project camunda-bpm-platform by camunda.
the class EnvScriptCachingTest method testDisabledPaEnvScriptCaching.
public void testDisabledPaEnvScriptCaching() {
// given
processEngineConfiguration.setEnableFetchScriptEngineFromProcessApplication(false);
EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication();
ProcessApplicationDeployment deployment = repositoryService.createDeployment(processApplication.getReference()).addClasspathResource(PROCESS_PATH).deploy();
// when
executeScript(processApplication);
// then
Map<String, List<ExecutableScript>> environmentScripts = processApplication.getEnvironmentScripts();
assertNotNull(environmentScripts);
assertNull(environmentScripts.get(SCRIPT_LANGUAGE));
repositoryService.deleteDeployment(deployment.getId(), true);
processEngineConfiguration.setEnableFetchScriptEngineFromProcessApplication(true);
}
Aggregations