use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByDecisionRequirementsDefinitionKey.
@Deployment(resources = { DRG_DMN })
public void testQueryByDecisionRequirementsDefinitionKey() {
decisionService.evaluateDecisionTableByKey(DISH_DECISION).variables(Variables.createVariables().putValue("temperature", 21).putValue("dayType", "Weekend")).evaluate();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.decisionRequirementsDefinitionKey("notExisting").count(), is(0L));
assertThat(query.decisionRequirementsDefinitionKey("dish").count(), is(3L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryByInvalidDecisionDefinitionKeyIn.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN, DRG_DMN })
public void testQueryByInvalidDecisionDefinitionKeyIn() {
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
try {
query.decisionDefinitionKeyIn("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 testQueryByProcessDefinitionKey.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testQueryByProcessDefinitionKey() {
String processDefinitionKey = repositoryService.createProcessDefinitionQuery().singleResult().getKey();
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.processDefinitionKey(processDefinitionKey).count(), is(1L));
assertThat(query.processDefinitionKey("other process").count(), is(0L));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryIncludeOutputs.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testQueryIncludeOutputs() {
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
try {
query.singleResult().getOutputs();
fail("expected exception: output not fetched");
} catch (ProcessEngineException e) {
// should throw exception if output is not fetched
}
assertThat(query.includeOutputs().singleResult().getOutputs().size(), is(1));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceQueryTest method testQueryIncludeInputsNoInput.
@Deployment(resources = { DECISION_PROCESS, DECISION_NO_INPUT_DMN })
public void testQueryIncludeInputsNoInput() {
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstanceQuery query = historyService.createHistoricDecisionInstanceQuery();
assertThat(query.includeInputs().singleResult().getInputs().size(), is(0));
}
Aggregations