use of org.camunda.bpm.engine.history.HistoricDecisionInstanceStatisticsQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionStatisticsRestServiceImpl method getDecisionStatistics.
@Override
public List<HistoricDecisionInstanceStatisticsDto> getDecisionStatistics(String decisionRequirementsDefinitionId, String decisionInstanceId) {
List<HistoricDecisionInstanceStatisticsDto> result = new ArrayList<HistoricDecisionInstanceStatisticsDto>();
HistoricDecisionInstanceStatisticsQuery statisticsQuery = processEngine.getHistoryService().createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinitionId);
if (decisionInstanceId != null) {
statisticsQuery.decisionInstanceId(decisionInstanceId);
}
for (HistoricDecisionInstanceStatistics stats : statisticsQuery.list()) {
result.add(HistoricDecisionInstanceStatisticsDto.fromDecisionDefinitionStatistics(stats));
}
return result;
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceStatisticsQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricDecisionInstanceStatisticsQueryTest method testQueryAuthenticatedTenant.
@Test
public void testQueryAuthenticatedTenant() {
DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_ONE).singleResult();
identityService.setAuthentication(USER_ID, null, Arrays.asList(TENANT_ONE));
HistoricDecisionInstanceStatisticsQuery query = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.getId());
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceStatisticsQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricDecisionInstanceStatisticsQueryTest method testQueryNoAuthenticatedTenants.
@Test
public void testQueryNoAuthenticatedTenants() {
DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_ONE).singleResult();
identityService.setAuthentication(USER_ID, null, null);
HistoricDecisionInstanceStatisticsQuery query = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.getId());
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceStatisticsQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricDecisionInstanceStatisticsQueryTest method testQueryDisabledTenantCheck.
@Test
public void testQueryDisabledTenantCheck() {
DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_ONE).singleResult();
engineRule.getProcessEngineConfiguration().setTenantCheckEnabled(false);
identityService.setAuthentication(USER_ID, null, null);
HistoricDecisionInstanceStatisticsQuery query = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.getId());
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceStatisticsQuery in project camunda-bpm-platform by camunda.
the class MultiTenancySharedDecisionInstanceStatisticsQueryTest method testQueryDisabledTenantCheck.
@Test
public void testQueryDisabledTenantCheck() {
DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().singleResult();
engineRule.getProcessEngineConfiguration().setTenantCheckEnabled(false);
identityService.setAuthentication(USER_ID, null, null);
HistoricDecisionInstanceStatisticsQuery query = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.getId());
assertThat(query.count(), is(3L));
}
Aggregations