public virtual void testMultipleSentries() { // given string caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().Id; // when string caseInstanceId = caseService.withCaseDefinition(caseDefinitionId).setVariable("myVar", 0).create().Id; // then CaseSentryPartQueryImpl query = createCaseSentryPartQuery(); assertEquals(2, query.count()); CaseSentryPartEntity part = query.sentryId("Sentry_1").singleResult(); assertEquals(caseInstanceId, part.CaseExecutionId); assertEquals(caseInstanceId, part.CaseInstanceId); assertEquals("Sentry_1", part.SentryId); assertEquals(CmmnSentryDeclaration.IF_PART, part.Type); assertNull(part.Source); assertNull(part.StandardEvent); assertFalse(part.Satisfied); part = query.sentryId("Sentry_2").singleResult(); assertEquals(caseInstanceId, part.CaseExecutionId); assertEquals(caseInstanceId, part.CaseInstanceId); assertEquals("Sentry_2", part.SentryId); assertEquals(CmmnSentryDeclaration.PLAN_ITEM_ON_PART, part.Type); assertEquals("PI_HumanTask_1", part.Source); assertEquals("complete", part.StandardEvent); assertFalse(part.Satisfied); }
public virtual void testOnPartIfPartAndVariableOnPart() { // given string caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().Id; // when string caseInstanceId = caseService.withCaseDefinition(caseDefinitionId).create().Id; // then CaseSentryPartQueryImpl query = createCaseSentryPartQuery(); assertEquals(3, query.count()); CaseSentryPartEntity part = query.type(CmmnSentryDeclaration.IF_PART).singleResult(); assertEquals(caseInstanceId, part.CaseExecutionId); assertEquals(caseInstanceId, part.CaseInstanceId); assertEquals("Sentry_1", part.SentryId); assertEquals(CmmnSentryDeclaration.IF_PART, part.Type); assertNull(part.Source); assertNull(part.StandardEvent); assertFalse(part.Satisfied); part = query.type(CmmnSentryDeclaration.PLAN_ITEM_ON_PART).singleResult(); assertEquals(caseInstanceId, part.CaseExecutionId); assertEquals(caseInstanceId, part.CaseInstanceId); assertEquals("Sentry_1", part.SentryId); assertEquals(CmmnSentryDeclaration.PLAN_ITEM_ON_PART, part.Type); assertEquals("PI_HumanTask_1", part.Source); assertEquals("complete", part.StandardEvent); assertFalse(part.Satisfied); part = query.type(CmmnSentryDeclaration.VARIABLE_ON_PART).singleResult(); assertEquals(caseInstanceId, part.CaseExecutionId); assertEquals(caseInstanceId, part.CaseInstanceId); assertEquals("Sentry_1", part.SentryId); assertEquals(CmmnSentryDeclaration.VARIABLE_ON_PART, part.Type); assertEquals(VariableTransition.delete.name(), part.VariableEvent); assertEquals("variable_1", part.VariableName); assertFalse(part.Satisfied); }
public virtual void testIfPart() { // given string caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().Id; // when string caseInstanceId = caseService.withCaseDefinition(caseDefinitionId).setVariable("myVar", 0).create().Id; // then IList <CaseSentryPartEntity> parts = createCaseSentryPartQuery().list(); assertEquals(1, parts.Count); CaseSentryPartEntity part = parts[0]; assertEquals(caseInstanceId, part.CaseExecutionId); assertEquals(caseInstanceId, part.CaseInstanceId); assertEquals("Sentry_1", part.SentryId); assertEquals(CmmnSentryDeclaration.IF_PART, part.Type); assertNull(part.Source); assertNull(part.StandardEvent); assertFalse(part.Satisfied); }
public virtual void testVariableOnPart() { // given string caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().Id; // when string caseInstanceId = caseService.withCaseDefinition(caseDefinitionId).create().Id; // then IList <CaseSentryPartEntity> parts = createCaseSentryPartQuery().list(); assertEquals(1, parts.Count); CaseSentryPartEntity part = parts[0]; assertEquals(caseInstanceId, part.CaseExecutionId); assertEquals(caseInstanceId, part.CaseInstanceId); assertEquals("Sentry_1", part.SentryId); assertEquals(CmmnSentryDeclaration.VARIABLE_ON_PART, part.Type); assertEquals(VariableTransition.create.name(), part.VariableEvent); assertEquals("variable_1", part.VariableName); assertFalse(part.Satisfied); }
public virtual void testOnPart() { // given string caseDefinitionId = repositoryService.createCaseDefinitionQuery().singleResult().Id; // when string caseInstanceId = caseService.withCaseDefinition(caseDefinitionId).create().Id; // then IList <CaseSentryPartEntity> parts = createCaseSentryPartQuery().list(); assertEquals(1, parts.Count); CaseSentryPartEntity part = parts[0]; assertEquals(caseInstanceId, part.CaseExecutionId); assertEquals(caseInstanceId, part.CaseInstanceId); assertEquals("Sentry_1", part.SentryId); assertEquals(CmmnSentryDeclaration.PLAN_ITEM_ON_PART, part.Type); assertEquals("PI_HumanTask_1", part.Source); assertEquals("complete", part.StandardEvent); assertFalse(part.Satisfied); }