use of org.camunda.bpm.engine.impl.cmmn.execution.CmmnSentryPart in project camunda-bpm-platform by camunda.
the class SentryEntryCriteriaTest method testAndFork.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/sentry/SentryEntryCriteriaTest.testAndFork.cmmn" })
public void testAndFork() {
// given
createCaseInstance();
CaseExecution firstHumanTask = queryCaseExecutionByActivityId("PI_HumanTask_1");
String firstHumanTaskId = firstHumanTask.getId();
assertTrue(firstHumanTask.isActive());
CaseExecution secondHumanTask = queryCaseExecutionByActivityId("PI_HumanTask_2");
String secondHumanTaskId = secondHumanTask.getId();
assertTrue(secondHumanTask.isAvailable());
CaseExecution thirdHumanTask = queryCaseExecutionByActivityId("PI_HumanTask_3");
String thirdHumanTaskId = thirdHumanTask.getId();
assertTrue(thirdHumanTask.isAvailable());
CaseSentryPartQueryImpl query = createCaseSentryPartQuery();
CmmnSentryPart part = query.singleResult();
assertFalse(part.isSatisfied());
// when
complete(firstHumanTaskId);
// then
secondHumanTask = queryCaseExecutionById(secondHumanTaskId);
assertTrue(secondHumanTask.isActive());
thirdHumanTask = queryCaseExecutionById(thirdHumanTaskId);
assertTrue(thirdHumanTask.isActive());
part = query.singleResult();
assertNotNull(part);
assertFalse(part.isSatisfied());
}
Aggregations