use of org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartEntity in project camunda-bpm-platform by camunda.
the class CaseSentryPartEntityTest method testSentryWithTenantId.
public void testSentryWithTenantId() {
CaseSentryPartEntity caseSentryPartEntity = new CaseSentryPartEntity();
caseSentryPartEntity.setTenantId("tenant1");
insertCaseSentryPart(caseSentryPartEntity);
caseSentryPartEntity = readCaseSentryPart();
assertThat(caseSentryPartEntity.getTenantId(), is("tenant1"));
deleteCaseSentryPart(caseSentryPartEntity);
}
use of org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartEntity in project camunda-bpm-platform by camunda.
the class SentryInitializationTest method testMultipleSentries.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/sentry/SentryInitializationTest.testMultipleSentries.cmmn" })
public void testMultipleSentries() {
// given
String caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().getId();
// when
String caseInstanceId = caseService.withCaseDefinition(caseDefinitionId).setVariable("myVar", 0).create().getId();
// then
CaseSentryPartQueryImpl query = createCaseSentryPartQuery();
assertEquals(2, query.count());
CaseSentryPartEntity part = query.sentryId("Sentry_1").singleResult();
assertEquals(caseInstanceId, part.getCaseExecutionId());
assertEquals(caseInstanceId, part.getCaseInstanceId());
assertEquals("Sentry_1", part.getSentryId());
assertEquals(CmmnSentryDeclaration.IF_PART, part.getType());
assertNull(part.getSource());
assertNull(part.getStandardEvent());
assertFalse(part.isSatisfied());
part = query.sentryId("Sentry_2").singleResult();
assertEquals(caseInstanceId, part.getCaseExecutionId());
assertEquals(caseInstanceId, part.getCaseInstanceId());
assertEquals("Sentry_2", part.getSentryId());
assertEquals(CmmnSentryDeclaration.PLAN_ITEM_ON_PART, part.getType());
assertEquals("PI_HumanTask_1", part.getSource());
assertEquals("complete", part.getStandardEvent());
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 testIfPart.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/sentry/SentryInitializationTest.testIfPart.cmmn" })
public void testIfPart() {
// given
String caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().getId();
// when
String caseInstanceId = caseService.withCaseDefinition(caseDefinitionId).setVariable("myVar", 0).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.IF_PART, part.getType());
assertNull(part.getSource());
assertNull(part.getStandardEvent());
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 testMultipleSentriesWithinStage.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/sentry/SentryInitializationTest.testMultipleSentriesWithinStage.cmmn" })
public void testMultipleSentriesWithinStage() {
// given
String caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().getId();
// when
String caseInstanceId = caseService.withCaseDefinition(caseDefinitionId).setVariable("myVar", 0).create().getId();
// then
CaseSentryPartQueryImpl query = createCaseSentryPartQuery();
assertEquals(2, query.count());
// when
String stageId = caseService.createCaseExecutionQuery().activityId("PI_Stage_1").singleResult().getId();
// then
assertEquals(2, query.count());
CaseSentryPartEntity part = query.sentryId("Sentry_1").singleResult();
assertEquals(caseInstanceId, part.getCaseInstanceId());
assertEquals(stageId, part.getCaseExecutionId());
assertEquals("Sentry_1", part.getSentryId());
assertEquals(CmmnSentryDeclaration.IF_PART, part.getType());
assertNull(part.getSource());
assertNull(part.getStandardEvent());
assertFalse(part.isSatisfied());
part = query.sentryId("Sentry_2").singleResult();
assertEquals(caseInstanceId, part.getCaseInstanceId());
assertEquals(stageId, part.getCaseExecutionId());
assertEquals("Sentry_2", part.getSentryId());
assertEquals(CmmnSentryDeclaration.PLAN_ITEM_ON_PART, part.getType());
assertEquals("PI_HumanTask_1", part.getSource());
assertEquals("complete", part.getStandardEvent());
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 testOnPartIfPartAndVariableOnPart.
@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/sentry/SentryInitializationTest.testOnPartIfPartAndVariableOnPart.cmmn" })
public void testOnPartIfPartAndVariableOnPart() {
// given
String caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().getId();
// when
String caseInstanceId = caseService.withCaseDefinition(caseDefinitionId).create().getId();
// then
CaseSentryPartQueryImpl query = createCaseSentryPartQuery();
assertEquals(3, query.count());
CaseSentryPartEntity part = query.type(CmmnSentryDeclaration.IF_PART).singleResult();
assertEquals(caseInstanceId, part.getCaseExecutionId());
assertEquals(caseInstanceId, part.getCaseInstanceId());
assertEquals("Sentry_1", part.getSentryId());
assertEquals(CmmnSentryDeclaration.IF_PART, part.getType());
assertNull(part.getSource());
assertNull(part.getStandardEvent());
assertFalse(part.isSatisfied());
part = query.type(CmmnSentryDeclaration.PLAN_ITEM_ON_PART).singleResult();
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());
part = query.type(CmmnSentryDeclaration.VARIABLE_ON_PART).singleResult();
assertEquals(caseInstanceId, part.getCaseExecutionId());
assertEquals(caseInstanceId, part.getCaseInstanceId());
assertEquals("Sentry_1", part.getSentryId());
assertEquals(CmmnSentryDeclaration.VARIABLE_ON_PART, part.getType());
assertEquals(VariableTransition.delete.name(), part.getVariableEvent());
assertEquals("variable_1", part.getVariableName());
assertFalse(part.isSatisfied());
}
Aggregations