use of org.camunda.bpm.engine.history.HistoricDecisionInstanceStatistics 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.HistoricDecisionInstanceStatistics in project camunda-bpm-platform by camunda.
the class MockProvider method createMockHistoricDecisionStatistics.
public static List<HistoricDecisionInstanceStatistics> createMockHistoricDecisionStatistics() {
HistoricDecisionInstanceStatistics statistics = mock(HistoricDecisionInstanceStatistics.class);
when(statistics.getDecisionDefinitionKey()).thenReturn(EXAMPLE_DECISION_DEFINITION_KEY);
when(statistics.getEvaluations()).thenReturn(1);
HistoricDecisionInstanceStatistics anotherStatistics = mock(HistoricDecisionInstanceStatistics.class);
when(anotherStatistics.getDecisionDefinitionKey()).thenReturn(ANOTHER_DECISION_DEFINITION_KEY);
when(anotherStatistics.getEvaluations()).thenReturn(2);
List<HistoricDecisionInstanceStatistics> decisionResults = new ArrayList<HistoricDecisionInstanceStatistics>();
decisionResults.add(statistics);
decisionResults.add(anotherStatistics);
return decisionResults;
}
Aggregations