Search in sources :

Example 1 with CmmnSentryPart

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());
}
Also used : CaseExecution(org.camunda.bpm.engine.runtime.CaseExecution) CmmnSentryPart(org.camunda.bpm.engine.impl.cmmn.execution.CmmnSentryPart) CaseSentryPartQueryImpl(org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartQueryImpl) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

CaseSentryPartQueryImpl (org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartQueryImpl)1 CmmnSentryPart (org.camunda.bpm.engine.impl.cmmn.execution.CmmnSentryPart)1 CaseExecution (org.camunda.bpm.engine.runtime.CaseExecution)1 Deployment (org.camunda.bpm.engine.test.Deployment)1