use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByCaseInstanceId.
@Deployment(resources = { DECISION_CASE, DECISION_SINGLE_OUTPUT_DMN })
public void testQueryByCaseInstanceId() {
CaseInstance caseInstance = createCaseInstanceAndEvaluateDecision();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.caseInstanceId(caseInstance.getId()).count(), is(1L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByEvaluatedBefore.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testQueryByEvaluatedBefore() {
Date beforeEvaluated = new Date(1441612000);
Date evaluated = new Date(1441613000);
Date afterEvaluated = new Date(1441614000);
ClockUtil.setCurrentTime(evaluated);
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.evaluatedBefore(afterEvaluated).count(), is(1L));
assertThat(query.evaluatedBefore(evaluated).count(), is(1L));
assertThat(query.evaluatedBefore(beforeEvaluated).count(), is(0L));
ClockUtil.reset();
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByInvalidCaseDefinitionKey.
public void testQueryByInvalidCaseDefinitionKey() {
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.caseDefinitionKey("invalid").count(), is(0L));
try {
query.caseDefinitionKey(null);
fail("exception expected");
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByInvalidDecisionDefinitionNameLike.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testQueryByInvalidDecisionDefinitionNameLike() {
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.decisionDefinitionNameLike("%invalid%").count(), is(0L));
try {
query.decisionDefinitionNameLike(null);
fail();
} catch (NotValidException e) {
// Expected exception
}
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByCaseDefinitionKey.
@Deployment(resources = { DECISION_CASE, DECISION_SINGLE_OUTPUT_DMN })
public void testQueryByCaseDefinitionKey() {
createCaseInstanceAndEvaluateDecision();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.caseDefinitionKey("case").count(), is(1L));
}
Aggregations