use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class AutoCompleteTest method testNested.
@Deployment
public void testNested() {
// given
// a deployed case definition
CaseExecutionQuery executionQuery = caseService.createCaseExecutionQuery();
// when
String caseInstanceId = createCaseInstanceByKey(CASE_DEFINITION_KEY).getId();
// then
CaseInstance caseInstance = caseService.createCaseInstanceQuery().caseInstanceId(caseInstanceId).singleResult();
assertNotNull(caseInstance);
assertTrue(caseInstance.isCompleted());
// stage, humanTask1, humanTask2, humanTask3 are not available
assertNull(executionQuery.activityId("PI_Stage_1").singleResult());
assertNull(executionQuery.activityId("PI_HumanTask_1").singleResult());
assertNull(executionQuery.activityId("PI_HumanTask_2").singleResult());
assertNull(executionQuery.activityId("PI_HumanTask_3").singleResult());
}
use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class AutoCompleteTest method testTerminate.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/stage/AutoCompleteTest.testRequiredEnabled.cmmn" })
public void testTerminate() {
// given
// a deployed case definition
String caseInstanceId = createCaseInstanceByKey(CASE_DEFINITION_KEY).getId();
CaseExecutionQuery executionQuery = caseService.createCaseExecutionQuery();
CaseInstanceQuery instanceQuery = caseService.createCaseInstanceQuery().caseInstanceId(caseInstanceId);
String humanTask2Id = executionQuery.activityId("PI_HumanTask_2").singleResult().getId();
manualStart(humanTask2Id);
// when
terminate(humanTask2Id);
// then
CaseInstance caseInstance = instanceQuery.singleResult();
assertNotNull(caseInstance);
assertTrue(caseInstance.isCompleted());
}
use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.
the class DmnDecisionTaskTest method testCallDecisionAsExpressionStartsWithHash.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/decisiontask/DmnDecisionTaskTest.testCallDecisionAsExpressionStartsWithHash.cmmn", DECISION_OKAY_DMN })
public void testCallDecisionAsExpressionStartsWithHash() {
// given
CaseInstance caseInstance = createCaseInstanceByKey(CASE_KEY, Variables.createVariables().putValue("testDecision", "testDecision"));
// 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 testIgnoreNonBlockingFlag.
@Deployment(resources = { CMMN_CALL_DECISION_CONSTANT, DECISION_OKAY_DMN })
public void testIgnoreNonBlockingFlag() {
// 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 testCallDecisionAsExpressionStartsWithDollar.
@Deployment(resources = { CMMN_CALL_DECISION_EXPRESSION, DECISION_OKAY_DMN })
public void testCallDecisionAsExpressionStartsWithDollar() {
// given
CaseInstance caseInstance = createCaseInstanceByKey(CASE_KEY, Variables.createVariables().putValue("testDecision", "testDecision"));
// then
assertNull(queryCaseExecutionByActivityId(DECISION_TASK));
assertEquals("okay", getDecisionResult(caseInstance));
}
Aggregations