use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByInvalidCaseDefinitionId.
public void testQueryByInvalidCaseDefinitionId() {
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.caseDefinitionId("invalid").count(), is(0L));
try {
query.caseDefinitionId(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 testQueryByUserId.
@Deployment(resources = { DECISION_SINGLE_OUTPUT_DMN })
public void testQueryByUserId() {
evaluateDecisionWithAuthenticatedUser("demo");
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.userId("demo").count(), is(1L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByEvaluatedAfter.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testQueryByEvaluatedAfter() {
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.evaluatedAfter(beforeEvaluated).count(), is(1L));
assertThat(query.evaluatedAfter(evaluated).count(), is(1L));
assertThat(query.evaluatedAfter(afterEvaluated).count(), is(0L));
ClockUtil.reset();
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByInvalidDecisionDefinitionIdIn.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN, DRG_DMN })
public void testQueryByInvalidDecisionDefinitionIdIn() {
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
try {
query.decisionDefinitionIdIn("aFake", null).count();
fail("exception expected");
} catch (ProcessEngineException e) {
// expected
}
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByDecisionDefinitionNameLike.
@Deployment(resources = { DECISION_PROCESS, DECISION_PROCESS_WITH_UNDERSCORE, DECISION_SINGLE_OUTPUT_DMN, DECISION_SINGLE_OUTPUT_DMN_WITH_UNDERSCORE })
public void testQueryByDecisionDefinitionNameLike() {
startProcessInstanceAndEvaluateDecision();
startProcessInstanceAndEvaluateDecisionWithUnderscore();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.decisionDefinitionNameLike("%ample dec%").count(), is(1L));
assertThat(query.decisionDefinitionNameLike("%ample\\_%").count(), is(1L));
}
Aggregations