Search in sources :

Example 96 with Deployment

use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.

the class DecisionServiceTest method evaluateDecisionByKey.

@Deployment(resources = DMN_DECISION_LITERAL_EXPRESSION)
@Test
public void evaluateDecisionByKey() {
    DmnDecisionResult decisionResult = decisionService.evaluateDecisionByKey(DECISION_DEFINITION_KEY).variables(createVariables()).evaluate();
    assertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
}
Also used : DmnDecisionResult(org.camunda.bpm.dmn.engine.DmnDecisionResult) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 97 with Deployment

use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.

the class DecisionServiceTest method evaluateDecisionTableByKeyWithNonExistingVersion.

@Deployment(resources = DMN_DECISION_TABLE)
@Test
public void evaluateDecisionTableByKeyWithNonExistingVersion() {
    DecisionDefinition decisionDefinition = repositoryService.createDecisionDefinitionQuery().singleResult();
    thrown.expect(NotFoundException.class);
    thrown.expectMessage("no decision definition deployed with key = 'decision' and version = '42'");
    decisionService.evaluateDecisionTableByKeyAndVersion(decisionDefinition.getKey(), 42, null);
}
Also used : DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 98 with Deployment

use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.

the class DecisionServiceTest method evaluateDecisionTableByKey.

@Deployment(resources = DMN_DECISION_TABLE)
@Test
public void evaluateDecisionTableByKey() {
    DmnDecisionTableResult decisionResult = decisionService.evaluateDecisionTableByKey(DECISION_DEFINITION_KEY, createVariables());
    assertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
}
Also used : DmnDecisionTableResult(org.camunda.bpm.dmn.engine.DmnDecisionTableResult) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 99 with Deployment

use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.

the class DecisionServiceTest method evaluateDecisionByKeyAndNullVersion.

@Deployment(resources = DMN_DECISION_LITERAL_EXPRESSION)
@Test
public void evaluateDecisionByKeyAndNullVersion() {
    testRule.deploy(DMN_DECISION_LITERAL_EXPRESSION_V2);
    DmnDecisionResult decisionResult = decisionService.evaluateDecisionByKey(DECISION_DEFINITION_KEY).version(null).variables(createVariables()).evaluate();
    assertThatDecisionHasResult(decisionResult, RESULT_OF_SECOND_VERSION);
}
Also used : DmnDecisionResult(org.camunda.bpm.dmn.engine.DmnDecisionResult) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 100 with Deployment

use of org.camunda.bpm.engine.test.Deployment in project camunda-bpm-platform by camunda.

the class DecisionServiceTest method evaluateDecisionWithRequiredDecisions.

@Deployment(resources = DRD_DISH_DECISION_TABLE)
@Test
public void evaluateDecisionWithRequiredDecisions() {
    DmnDecisionTableResult decisionResult = decisionService.evaluateDecisionTableByKey("dish-decision", Variables.createVariables().putValue("temperature", 32).putValue("dayType", "Weekend"));
    assertThatDecisionHasResult(decisionResult, "Light salad");
}
Also used : DmnDecisionTableResult(org.camunda.bpm.dmn.engine.DmnDecisionTableResult) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

Deployment (org.camunda.bpm.engine.test.Deployment)3376 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)1325 Task (org.camunda.bpm.engine.task.Task)788 Test (org.junit.Test)635 HashMap (java.util.HashMap)441 Job (org.camunda.bpm.engine.runtime.Job)310 ActivityInstance (org.camunda.bpm.engine.runtime.ActivityInstance)277 VariableInstance (org.camunda.bpm.engine.runtime.VariableInstance)265 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)256 CaseExecution (org.camunda.bpm.engine.runtime.CaseExecution)251 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)230 VariableInstanceQuery (org.camunda.bpm.engine.runtime.VariableInstanceQuery)206 TaskQuery (org.camunda.bpm.engine.task.TaskQuery)195 Execution (org.camunda.bpm.engine.runtime.Execution)189 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)175 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)161 CaseInstance (org.camunda.bpm.engine.runtime.CaseInstance)149 JobQuery (org.camunda.bpm.engine.runtime.JobQuery)143 ExecutionAssert.describeExecutionTree (org.camunda.bpm.engine.test.util.ExecutionAssert.describeExecutionTree)134 ExecutionTree (org.camunda.bpm.engine.test.util.ExecutionTree)134