use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class DmnDecisionTaskTest method testCallDecisionAsConstant.
@Deployment(resources = { CMMN_CALL_DECISION_CONSTANT, DECISION_OKAY_DMN })
public void testCallDecisionAsConstant() {
// given
CaseInstance caseInstance = createCaseInstanceByKey(CASE_KEY);
// then
assertNull(queryCaseExecutionByActivityId(DECISION_TASK));
assertEquals("okay", getDecisionResult(caseInstance));
}
use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class DmnDecisionTaskTest method testCallDecisionWithRequiredDecisions.
@Deployment(resources = { CMMN_CALL_DECISION_EXPRESSION, DRD_DISH_RESOURCE })
public void testCallDecisionWithRequiredDecisions() {
// given
CaseInstance caseInstance = createCaseInstanceByKey(CASE_KEY, Variables.createVariables().putValue("testDecision", "dish-decision").putValue("temperature", 32).putValue("dayType", "Weekend"));
// then
assertNull(queryCaseExecutionByActivityId(DECISION_TASK));
assertEquals("Light salad", getDecisionResult(caseInstance));
}
use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class ProcessTaskTest method testNonBlockingProcessTask.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/processtask/ProcessTaskTest.testNonBlockingProcessTask.cmmn", "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" })
public void testNonBlockingProcessTask() {
// given
String caseInstanceId = createCaseInstanceByKey(ONE_PROCESS_TASK_CASE).getId();
// then
ProcessInstance processInstance = queryProcessInstance();
assertNotNull(processInstance);
Task task = queryTask();
assertNotNull(task);
CaseExecution processTask = queryCaseExecutionByActivityId(PROCESS_TASK);
assertNull(processTask);
CaseInstance caseInstance = caseService.createCaseInstanceQuery().singleResult();
assertNotNull(caseInstance);
assertTrue(caseInstance.isCompleted());
// complete ////////////////////////////////////////////////////////
close(caseInstanceId);
assertCaseEnded(caseInstanceId);
String taskId = queryTask().getId();
taskService.complete(taskId);
assertProcessEnded(processInstance.getId());
}
use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class RequiredRuleTest method testRequiredRuleEvaluatesToTrue.
@Deployment(resources = "org/camunda/bpm/engine/test/cmmn/required/RequiredRuleTest.testVariableBasedRule.cmmn")
public void testRequiredRuleEvaluatesToTrue() {
CaseInstance caseInstance = caseService.createCaseInstanceByKey("case", Collections.<String, Object>singletonMap("required", true));
CaseExecution taskExecution = caseService.createCaseExecutionQuery().activityId("PI_HumanTask_1").singleResult();
assertNotNull(taskExecution);
assertTrue(taskExecution.isRequired());
try {
caseService.completeCaseExecution(caseInstance.getId());
fail("completing the containing stage should not be allowed");
} catch (NotAllowedException e) {
// happy path
}
}
use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class RequiredRuleTest method testDefaultRequiredRuleEvaluatesToTrue.
@Deployment(resources = "org/camunda/bpm/engine/test/cmmn/required/RequiredRuleTest.testDefaultVariableBasedRule.cmmn")
public void testDefaultRequiredRuleEvaluatesToTrue() {
CaseInstance caseInstance = caseService.createCaseInstanceByKey("case", Collections.<String, Object>singletonMap("required", true));
CaseExecution taskExecution = caseService.createCaseExecutionQuery().activityId("PI_HumanTask_1").singleResult();
assertNotNull(taskExecution);
assertTrue(taskExecution.isRequired());
try {
caseService.completeCaseExecution(caseInstance.getId());
fail("completing the containing stage should not be allowed");
} catch (NotAllowedException e) {
// happy path
}
}
Aggregations