Search in sources :

Example 26 with HistoricDecisionInstanceQuery

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

Example 27 with HistoricDecisionInstanceQuery

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

Example 28 with HistoricDecisionInstanceQuery

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

Example 29 with HistoricDecisionInstanceQuery

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

Example 30 with HistoricDecisionInstanceQuery

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

Aggregations

HistoricDecisionInstanceQuery (org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery)82 Deployment (org.camunda.bpm.engine.test.Deployment)37 NativeHistoricDecisionInstanceQuery (org.camunda.bpm.engine.history.NativeHistoricDecisionInstanceQuery)36 Test (org.junit.Test)22 Batch (org.camunda.bpm.engine.batch.Batch)17 Job (org.camunda.bpm.engine.runtime.Job)9 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)7 HistoricDecisionInstance (org.camunda.bpm.engine.history.HistoricDecisionInstance)7 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)6 AbstractRestServiceTest (org.camunda.bpm.engine.rest.AbstractRestServiceTest)4 Response (com.jayway.restassured.response.Response)3 HashMap (java.util.HashMap)3 HistoricBatch (org.camunda.bpm.engine.batch.history.HistoricBatch)3 Matchers.anyString (org.mockito.Matchers.anyString)3 Date (java.util.Date)2 List (java.util.List)2 BadUserRequestException (org.camunda.bpm.engine.BadUserRequestException)2 UserOperationLogEntry (org.camunda.bpm.engine.history.UserOperationLogEntry)2 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)2 DecisionRequirementsDefinition (org.camunda.bpm.engine.repository.DecisionRequirementsDefinition)2