Search in sources :

Example 21 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class ProcessApplicationDeploymentTest method testProcessApplicationDeploymentSourceAwareDuplicateFilter.

public void testProcessApplicationDeploymentSourceAwareDuplicateFilter() {
    // 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).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 22 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class ProcessApplicationDeploymentTest method testDeploymentSourceShouldBeNull.

public void testDeploymentSourceShouldBeNull() {
    String key = "process";
    BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();
    DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
    Deployment deployment1 = repositoryService.createDeployment().name("first-deployment-without-a-source").addModelInstance("process.bpmn", model).deploy();
    assertNull(deploymentQuery.deploymentName("first-deployment-without-a-source").singleResult().getSource());
    Deployment deployment2 = repositoryService.createDeployment(processApplication.getReference()).name("second-deployment-with-a-source").source(null).addModelInstance("process.bpmn", model).deploy();
    assertNull(deploymentQuery.deploymentName("second-deployment-with-a-source").singleResult().getSource());
    deleteDeployments(deployment1, deployment2);
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) Deployment(org.camunda.bpm.engine.repository.Deployment) BpmnModelInstance(org.camunda.bpm.model.bpmn.BpmnModelInstance)

Example 23 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class ProcessApplicationDeploymentTest method testDefaultDeploymentSource.

public void testDefaultDeploymentSource() {
    String key = "process";
    BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();
    DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
    Deployment deployment = repositoryService.createDeployment(processApplication.getReference()).name("first-deployment-with-a-source").addModelInstance("process.bpmn", model).deploy();
    assertEquals(ProcessApplicationDeployment.PROCESS_APPLICATION_DEPLOYMENT_SOURCE, deploymentQuery.deploymentName("first-deployment-with-a-source").singleResult().getSource());
    deleteDeployments(deployment);
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) ProcessApplicationDeployment(org.camunda.bpm.engine.repository.ProcessApplicationDeployment) Deployment(org.camunda.bpm.engine.repository.Deployment) BpmnModelInstance(org.camunda.bpm.model.bpmn.BpmnModelInstance)

Example 24 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery 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 25 with DeploymentQuery

use of org.camunda.bpm.engine.repository.DeploymentQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyDeploymentCmdsTenantCheckTest method redeployForDifferentAuthenticatedTenantsDisabledTenantCheck.

@Test
public void redeployForDifferentAuthenticatedTenantsDisabledTenantCheck() {
    Deployment deploymentOne = repositoryService.createDeployment().addModelInstance("emptyProcess.bpmn", emptyProcess).addModelInstance("startEndProcess.bpmn", startEndProcess).tenantId(TENANT_ONE).deploy();
    identityService.setAuthentication("user", null, null);
    processEngineConfiguration.setTenantCheckEnabled(false);
    repositoryService.createDeployment().addDeploymentResources(deploymentOne.getId()).tenantId(TENANT_TWO).deploy();
    DeploymentQuery query = repositoryService.createDeploymentQuery();
    assertThat(query.count(), is(2L));
    assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
    assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
Also used : DeploymentQuery(org.camunda.bpm.engine.repository.DeploymentQuery) Deployment(org.camunda.bpm.engine.repository.Deployment) Test(org.junit.Test)

Aggregations

DeploymentQuery (org.camunda.bpm.engine.repository.DeploymentQuery)58 ProcessApplicationDeployment (org.camunda.bpm.engine.repository.ProcessApplicationDeployment)13 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)13 Deployment (org.camunda.bpm.engine.repository.Deployment)11 ProcessDefinitionQuery (org.camunda.bpm.engine.repository.ProcessDefinitionQuery)8 Test (org.junit.Test)7 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)5 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)4