use of org.camunda.bpm.engine.history.NativeHistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testNativeQueryPaging.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testNativeQueryPaging() {
startProcessInstanceAndEvaluateDecision();
startProcessInstanceAndEvaluateDecision();
String tablePrefix = processEngineConfiguration.getDatabaseTablePrefix();
NativeHistoricDecisionInstanceQuery nativeQuery = historyService.createNativeHistoricDecisionInstanceQuery().sql("SELECT * FROM " + tablePrefix + "ACT_HI_DECINST");
assertThat(nativeQuery.listPage(0, 2).size(), is(2));
assertThat(nativeQuery.listPage(1, 1).size(), is(1));
}
use of org.camunda.bpm.engine.history.NativeHistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testNativeCountQuery.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testNativeCountQuery() {
startProcessInstanceAndEvaluateDecision();
String tablePrefix = processEngineConfiguration.getDatabaseTablePrefix();
NativeHistoricDecisionInstanceQuery nativeQuery = historyService.createNativeHistoricDecisionInstanceQuery().sql("SELECT count(*) FROM " + tablePrefix + "ACT_HI_DECINST");
assertThat(nativeQuery.count(), is(1L));
}
use of org.camunda.bpm.engine.history.NativeHistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testNativeQuery.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testNativeQuery() {
startProcessInstanceAndEvaluateDecision();
String tablePrefix = processEngineConfiguration.getDatabaseTablePrefix();
NativeHistoricDecisionInstanceQuery nativeQuery = historyService.createNativeHistoricDecisionInstanceQuery().sql("SELECT * FROM " + tablePrefix + "ACT_HI_DECINST");
assertThat(nativeQuery.list().size(), is(1));
NativeHistoricDecisionInstanceQuery nativeQueryWithParameter = historyService.createNativeHistoricDecisionInstanceQuery().sql("SELECT * FROM " + tablePrefix + "ACT_HI_DECINST H WHERE H.DEC_DEF_KEY_ = #{decisionDefinitionKey}");
assertThat(nativeQueryWithParameter.parameter("decisionDefinitionKey", DECISION_DEFINITION_KEY).list().size(), is(1));
assertThat(nativeQueryWithParameter.parameter("decisionDefinitionKey", "other decision").list().size(), is(0));
}
Aggregations