use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByDecisionDefinitionName.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testQueryByDecisionDefinitionName() {
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.decisionDefinitionName("sample decision").count(), is(1L));
assertThat(query.decisionDefinitionName("other name").count(), is(0L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByProcessInstanceId.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testQueryByProcessInstanceId() {
startProcessInstanceAndEvaluateDecision();
String processInstanceId = runtimeService.createProcessInstanceQuery().singleResult().getId();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.processInstanceId(processInstanceId).count(), is(1L));
assertThat(query.processInstanceId("other process").count(), is(0L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByDecisionDefinitionKeyIn.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN, DRG_DMN })
public void testQueryByDecisionDefinitionKeyIn() {
// when
startProcessInstanceAndEvaluateDecision();
decisionService.evaluateDecisionTableByKey(DISH_DECISION).variables(Variables.createVariables().putValue("temperature", 21).putValue("dayType", "Weekend")).evaluate();
// then
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.decisionDefinitionKeyIn(DISH_DECISION, DECISION_DEFINITION_KEY).count(), is(2L));
assertThat(query.decisionDefinitionKeyIn("other id", "anotherFake").count(), is(0L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByDecisionDefinitionId.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testQueryByDecisionDefinitionId() {
String decisionDefinitionId = repositoryService.createDecisionDefinitionQuery().decisionDefinitionKey(DECISION_DEFINITION_KEY).singleResult().getId();
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.decisionDefinitionId(decisionDefinitionId).count(), is(1L));
assertThat(query.decisionDefinitionId("other id").count(), is(0L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByDecisionRequirementsDefinitionId.
@Deployment(resources = { DRG_DMN })
public void testQueryByDecisionRequirementsDefinitionId() {
decisionService.evaluateDecisionTableByKey(DISH_DECISION).variables(Variables.createVariables().putValue("temperature", 21).putValue("dayType", "Weekend")).evaluate();
DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().singleResult();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.decisionRequirementsDefinitionId("notExisting").count(), is(0L));
assertThat(query.decisionRequirementsDefinitionId(decisionRequirementsDefinition.getId()).count(), is(3L));
}
Aggregations