use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.
the class DecisionDefinitionQueryTest method querySorting.
@Test
public void querySorting() {
DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
// asc
query.orderByDecisionDefinitionId().asc();
verifyQueryResults(query, 4);
query = repositoryService.createDecisionDefinitionQuery();
query.orderByDeploymentId().asc();
verifyQueryResults(query, 4);
query = repositoryService.createDecisionDefinitionQuery();
query.orderByDecisionDefinitionKey().asc();
verifyQueryResults(query, 4);
query = repositoryService.createDecisionDefinitionQuery();
query.orderByDecisionDefinitionVersion().asc();
verifyQueryResults(query, 4);
// desc
query = repositoryService.createDecisionDefinitionQuery();
query.orderByDecisionDefinitionId().desc();
verifyQueryResults(query, 4);
query = repositoryService.createDecisionDefinitionQuery();
query.orderByDeploymentId().desc();
verifyQueryResults(query, 4);
query = repositoryService.createDecisionDefinitionQuery();
query.orderByDecisionDefinitionKey().desc();
verifyQueryResults(query, 4);
query = repositoryService.createDecisionDefinitionQuery();
query.orderByDecisionDefinitionVersion().desc();
verifyQueryResults(query, 4);
query = repositoryService.createDecisionDefinitionQuery();
// Typical use decision
query.orderByDecisionDefinitionKey().asc().orderByDecisionDefinitionVersion().desc();
List<DecisionDefinition> decisionDefinitions = query.list();
assertEquals(4, decisionDefinitions.size());
assertEquals("one", decisionDefinitions.get(0).getKey());
assertEquals(2, decisionDefinitions.get(0).getVersion());
assertEquals("one", decisionDefinitions.get(1).getKey());
assertEquals(1, decisionDefinitions.get(1).getVersion());
assertEquals("two", decisionDefinitions.get(2).getKey());
assertEquals(1, decisionDefinitions.get(2).getVersion());
}
use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionDefinitionCmdsTenantCheckTest method getDecisionDefinitionDisabledTenantCheck.
@Test
public void getDecisionDefinitionDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
DecisionDefinition definition = repositoryService.getDecisionDefinition(decisionDefinitionId);
assertThat(definition.getTenantId(), is(TENANT_ONE));
}
use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionDefinitionCmdsTenantCheckTest method getDecisionDefinitionWithAuthenticatedTenant.
@Test
public void getDecisionDefinitionWithAuthenticatedTenant() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
DecisionDefinition definition = repositoryService.getDecisionDefinition(decisionDefinitionId);
assertThat(definition.getTenantId(), is(TENANT_ONE));
}
use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionDefinitionCmdsTenantCheckTest method updateHistoryTimeToLiveWithAuthenticatedTenant.
@Test
public void updateHistoryTimeToLiveWithAuthenticatedTenant() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
repositoryService.updateDecisionDefinitionHistoryTimeToLive(decisionDefinitionId, 6);
DecisionDefinition definition = repositoryService.getDecisionDefinition(decisionDefinitionId);
assertThat(definition.getTenantId(), is(TENANT_ONE));
assertThat(definition.getHistoryTimeToLive(), is(6));
}
use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.
the class EvaluateDecisionTableCmd method execute.
@Override
public DmnDecisionTableResult execute(CommandContext commandContext) {
ensureOnlyOneNotNull("either decision definition id or key must be set", decisionDefinitionId, decisionDefinitionKey);
DecisionDefinition decisionDefinition = getDecisionDefinition(commandContext);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkEvaluateDecision(decisionDefinition);
}
return doEvaluateDecision(decisionDefinition, variables);
}
Aggregations