use of org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartEntity in project camunda-bpm-platform by camunda.
the class CmmnExecution method forceUpdateOnCaseSentryParts.
protected void forceUpdateOnCaseSentryParts(List<CmmnSentryPart> sentryParts) {
// same sentry has been satisfied concurrently.
for (CmmnSentryPart sentryPart : sentryParts) {
if (sentryPart instanceof CaseSentryPartEntity) {
CaseSentryPartEntity sentryPartEntity = (CaseSentryPartEntity) sentryPart;
sentryPartEntity.forceUpdate();
}
}
}
use of org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartEntity in project camunda-bpm-platform by camunda.
the class CmmnExecution method forceUpdateOnSentries.
protected void forceUpdateOnSentries(List<String> sentryIds) {
for (String sentryId : sentryIds) {
List<? extends CmmnSentryPart> sentryParts = findSentry(sentryId);
// same sentry has been satisfied concurrently.
for (CmmnSentryPart sentryPart : sentryParts) {
if (sentryPart instanceof CaseSentryPartEntity) {
CaseSentryPartEntity sentryPartEntity = (CaseSentryPartEntity) sentryPart;
sentryPartEntity.forceUpdate();
}
}
}
}
use of org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartEntity in project camunda-bpm-platform by camunda.
the class SentryScenarioTest method testTriggerTaskEntryCriterion.
@Test
@ScenarioUnderTest("triggerTaskEntryCriterion.1")
public void testTriggerTaskEntryCriterion() {
// given
// enabled human task inside a stage instance
String firstHumanTaskId = rule.caseExecutionQuery().activityId("PI_HumanTask_1").singleResult().getId();
// when
// start and complete human task
caseService.manuallyStartCaseExecution(firstHumanTaskId);
caseService.completeCaseExecution(firstHumanTaskId);
// then
// entry criterion of the second human task inside the stage instance
// will be triggered
CaseExecution secondHumanTask = rule.caseExecutionQuery().activityId("PI_HumanTask_2").singleResult();
// ... and the task is enabled
assertTrue(secondHumanTask.isEnabled());
CaseSentryPartEntity sentryPart = createCaseSentryPartQuery().sourceCaseExecutionId(firstHumanTaskId).singleResult();
// the associated sentry part is not satisfied
assertFalse(sentryPart.isSatisfied());
// the source is null (because this sentry part
// has been migrated into 7.4)
assertNull(sentryPart.getSource());
}
use of org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartEntity in project camunda-bpm-platform by camunda.
the class SentryInitializationTest method testVariableOnPart.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/sentry/SentryInitializationTest.testVariableOnPart.cmmn" })
public void testVariableOnPart() {
// given
String caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().getId();
// when
String caseInstanceId = caseService.withCaseDefinition(caseDefinitionId).create().getId();
// then
List<CaseSentryPartEntity> parts = createCaseSentryPartQuery().list();
assertEquals(1, parts.size());
CaseSentryPartEntity part = parts.get(0);
assertEquals(caseInstanceId, part.getCaseExecutionId());
assertEquals(caseInstanceId, part.getCaseInstanceId());
assertEquals("Sentry_1", part.getSentryId());
assertEquals(CmmnSentryDeclaration.VARIABLE_ON_PART, part.getType());
assertEquals(VariableTransition.create.name(), part.getVariableEvent());
assertEquals("variable_1", part.getVariableName());
assertFalse(part.isSatisfied());
}
use of org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartEntity in project camunda-bpm-platform by camunda.
the class SentryInitializationTest method testOnPart.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/sentry/SentryInitializationTest.testOnPart.cmmn" })
public void testOnPart() {
// given
String caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().getId();
// when
String caseInstanceId = caseService.withCaseDefinition(caseDefinitionId).create().getId();
// then
List<CaseSentryPartEntity> parts = createCaseSentryPartQuery().list();
assertEquals(1, parts.size());
CaseSentryPartEntity part = parts.get(0);
assertEquals(caseInstanceId, part.getCaseExecutionId());
assertEquals(caseInstanceId, part.getCaseInstanceId());
assertEquals("Sentry_1", part.getSentryId());
assertEquals(CmmnSentryDeclaration.PLAN_ITEM_ON_PART, part.getType());
assertEquals("PI_HumanTask_1", part.getSource());
assertEquals("complete", part.getStandardEvent());
assertFalse(part.isSatisfied());
}
Aggregations