Search in sources :

Example 11 with ProcessApplicationDeployment

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);
}
Also used : ProcessApplicationRegistration(org.camunda.bpm.application.ProcessApplicationRegistration) ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment)

Example 12 with ProcessApplicationDeployment

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);
}
Also used : ProcessApplicationRegistration(org.camunda.bpm.application.ProcessApplicationRegistration) ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) BpmnModelInstance(org.camunda.bpm.model.bpmn.BpmnModelInstance)

Example 13 with ProcessApplicationDeployment

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);
}
Also used : ProcessApplicationRegistration(org.camunda.bpm.application.ProcessApplicationRegistration) ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition)

Example 14 with ProcessApplicationDeployment

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);
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) ProcessDefinitionQuery(org.camunda.bpm.engine.repository.ProcessDefinitionQuery) BpmnModelInstance(org.camunda.bpm.model.bpmn.BpmnModelInstance)

Example 15 with ProcessApplicationDeployment

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);
}
Also used : ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) EmbeddedProcessApplication(org.camunda.bpm.application.impl.EmbeddedProcessApplication) List(java.util.List)

Aggregations

ProcessApplicationDeployment (org.camunda.bpm.engine.repository.ProcessApplicationDeployment)31 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)17 ProcessApplicationRegistration (org.camunda.bpm.application.ProcessApplicationRegistration)15 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)9 EmbeddedProcessApplication (org.camunda.bpm.application.impl.EmbeddedProcessApplication)8 DeploymentQuery (org.camunda.bpm.engine.repository.DeploymentQuery)8 ProcessDefinitionQuery (org.camunda.bpm.engine.repository.ProcessDefinitionQuery)8 ScriptEngine (javax.script.ScriptEngine)3 Resource (org.camunda.bpm.engine.repository.Resource)3 List (java.util.List)2 ArrayList (java.util.ArrayList)1 ProcessApplicationDeploymentInfo (org.camunda.bpm.application.ProcessApplicationDeploymentInfo)1 ProcessApplicationInterface (org.camunda.bpm.application.ProcessApplicationInterface)1 ProcessApplicationDeploymentInfoImpl (org.camunda.bpm.application.impl.ProcessApplicationDeploymentInfoImpl)1 ProcessApplicationInfoImpl (org.camunda.bpm.application.impl.ProcessApplicationInfoImpl)1 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)1 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)1 ExecutableScript (org.camunda.bpm.engine.impl.scripting.ExecutableScript)1 SourceExecutableScript (org.camunda.bpm.engine.impl.scripting.SourceExecutableScript)1 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)1