Search in sources :

Example 1 with DecisionRequirementsDefinitionQuery

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

the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByTenantId.

@Test
public void queryByTenantId() {
    DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_ONE);
    assertThat(query.count(), is(1L));
    query = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_TWO);
    assertThat(query.count(), is(1L));
}
Also used : DecisionRequirementsDefinitionQuery(org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery) Test(org.junit.Test)

Example 2 with DecisionRequirementsDefinitionQuery

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

the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByDefinitionsWithoutTenantId.

@Test
public void queryByDefinitionsWithoutTenantId() {
    DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().withoutTenantId();
    assertThat(query.count(), is(1L));
}
Also used : DecisionRequirementsDefinitionQuery(org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery) Test(org.junit.Test)

Example 3 with DecisionRequirementsDefinitionQuery

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

the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByLatestWithoutTenantId.

@Test
public void queryByLatestWithoutTenantId() {
    // deploy a second version without tenant id
    testRule.deploy(DMN);
    DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().decisionRequirementsDefinitionKey(DECISION_REQUIREMENTS_DEFINITION_KEY).latestVersion().withoutTenantId();
    assertThat(query.count(), is(1L));
    DecisionRequirementsDefinition DecisionRequirementsDefinition = query.singleResult();
    assertThat(DecisionRequirementsDefinition.getTenantId(), is(nullValue()));
    assertThat(DecisionRequirementsDefinition.getVersion(), is(2));
}
Also used : DecisionRequirementsDefinitionQuery(org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery) DecisionRequirementsDefinition(org.camunda.bpm.engine.repository.DecisionRequirementsDefinition) Test(org.junit.Test)

Example 4 with DecisionRequirementsDefinitionQuery

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

the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByTenantIdsIncludeDefinitionsWithoutTenantId.

@Test
public void queryByTenantIdsIncludeDefinitionsWithoutTenantId() {
    DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_ONE).includeDecisionRequirementsDefinitionsWithoutTenantId();
    assertThat(query.count(), is(2L));
    query = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_TWO).includeDecisionRequirementsDefinitionsWithoutTenantId();
    assertThat(query.count(), is(2L));
    query = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_ONE, TENANT_TWO).includeDecisionRequirementsDefinitionsWithoutTenantId();
    assertThat(query.count(), is(3L));
}
Also used : DecisionRequirementsDefinitionQuery(org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery) Test(org.junit.Test)

Example 5 with DecisionRequirementsDefinitionQuery

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

the class MultiTenancyDecisionRequirementsDefinitionQueryTest method queryByLatestWithTenantIdsIncludeDefinitionsWithoutTenantId.

@Test
public void queryByLatestWithTenantIdsIncludeDefinitionsWithoutTenantId() {
    // deploy a second version without tenant id
    testRule.deploy(DMN);
    // deploy a third version for tenant one
    testRule.deployForTenant(TENANT_ONE, DMN);
    testRule.deployForTenant(TENANT_ONE, DMN);
    DecisionRequirementsDefinitionQuery query = repositoryService.createDecisionRequirementsDefinitionQuery().decisionRequirementsDefinitionKey(DECISION_REQUIREMENTS_DEFINITION_KEY).latestVersion().tenantIdIn(TENANT_ONE, TENANT_TWO).includeDecisionRequirementsDefinitionsWithoutTenantId();
    assertThat(query.count(), is(3L));
    Map<String, DecisionRequirementsDefinition> definitionsForTenant = getDecisionRequirementsDefinitionsForTenant(query.list());
    assertThat(definitionsForTenant.get(TENANT_ONE).getVersion(), is(3));
    assertThat(definitionsForTenant.get(TENANT_TWO).getVersion(), is(1));
    assertThat(definitionsForTenant.get(null).getVersion(), is(2));
}
Also used : DecisionRequirementsDefinitionQuery(org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery) DecisionRequirementsDefinition(org.camunda.bpm.engine.repository.DecisionRequirementsDefinition) Test(org.junit.Test)

Aggregations

DecisionRequirementsDefinitionQuery (org.camunda.bpm.engine.repository.DecisionRequirementsDefinitionQuery)37 Test (org.junit.Test)31 DecisionRequirementsDefinition (org.camunda.bpm.engine.repository.DecisionRequirementsDefinition)9 Deployment (org.camunda.bpm.engine.test.Deployment)4 InputStream (java.io.InputStream)2 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 DecisionRequirementsDefinitionQueryDto (org.camunda.bpm.engine.rest.dto.repository.DecisionRequirementsDefinitionQueryDto)2 ArrayList (java.util.ArrayList)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 DecisionRequirementsDefinitionDto (org.camunda.bpm.engine.rest.dto.repository.DecisionRequirementsDefinitionDto)1