Search in sources :

Example 1 with NativeHistoricDecisionInstanceQuery

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));
}
Also used : NativeHistoricDecisionInstanceQuery(org.camunda.bpm.engine.history.NativeHistoricDecisionInstanceQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 2 with NativeHistoricDecisionInstanceQuery

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));
}
Also used : NativeHistoricDecisionInstanceQuery(org.camunda.bpm.engine.history.NativeHistoricDecisionInstanceQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 3 with NativeHistoricDecisionInstanceQuery

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));
}
Also used : NativeHistoricDecisionInstanceQuery(org.camunda.bpm.engine.history.NativeHistoricDecisionInstanceQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

NativeHistoricDecisionInstanceQuery (org.camunda.bpm.engine.history.NativeHistoricDecisionInstanceQuery)3 Deployment (org.camunda.bpm.engine.test.Deployment)3