Ejemplo n.º 1
0
        public virtual void testTriggerStageEntryCriterion()
        {
            // given
            string secondHumanTaskId = rule.caseExecutionQuery().activityId("PI_HumanTask_2").singleResult().Id;
            string firstStageId      = rule.caseExecutionQuery().activityId("PI_Stage_1").singleResult().Id;

            // when
            // complete human task
            caseService.completeCaseExecution(secondHumanTaskId);

            // then
            // "PI_Stage_1" should be completed
            CaseExecution firstStage = rule.caseExecutionQuery().activityId("PI_Stage_1").singleResult();

            assertNull(firstStage);

            // "PI_Stage_2" should be enabled
            CaseExecution secondStage = rule.caseExecutionQuery().activityId("PI_Stage_2").singleResult();

            assertNotNull(secondStage);
            assertTrue(secondStage.Enabled);

            CaseSentryPartEntity sentryPart = createCaseSentryPartQuery().sourceCaseExecutionId(firstStageId).singleResult();

            // the associated sentry part is not satisfied
            assertFalse(sentryPart.Satisfied);
            // the source is null (since this sentry part
            // has been migrated into 7.4)
            assertNull(sentryPart.Source);
        }
Ejemplo n.º 2
0
        public virtual void testTriggerTaskEntryCriterion()
        {
            // given
            // enabled human task inside a stage instance
            string firstHumanTaskId = rule.caseExecutionQuery().activityId("PI_HumanTask_1").singleResult().Id;

            // 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.Enabled);

            CaseSentryPartEntity sentryPart = createCaseSentryPartQuery().sourceCaseExecutionId(firstHumanTaskId).singleResult();

            // the associated sentry part is not satisfied
            assertFalse(sentryPart.Satisfied);
            // the source is null (because this sentry part
            // has been migrated into 7.4)
            assertNull(sentryPart.Source);
        }
Ejemplo n.º 3
0
        public virtual void testSentryWithTenantId()
        {
            CaseSentryPartEntity caseSentryPartEntity = new CaseSentryPartEntity();

            caseSentryPartEntity.TenantId = "tenant1";

            insertCaseSentryPart(caseSentryPartEntity);

            caseSentryPartEntity = readCaseSentryPart();
            assertThat(caseSentryPartEntity.TenantId, @is("tenant1"));

            deleteCaseSentryPart(caseSentryPartEntity);
        }
Ejemplo n.º 4
0
        public virtual void testNewSentryInstance()
        {
            // given
            string secondStageId = rule.caseExecutionQuery().activityId("PI_Stage_2").singleResult().Id;

            // when
            // start human task
            caseService.manuallyStartCaseExecution(secondStageId);

            // then
            // a new sentry instance should be created
            CaseSentryPartEntity sentryPart = createCaseSentryPartQuery().caseExecutionId(secondStageId).singleResult();

            assertNotNull(sentryPart);
            assertFalse(sentryPart.Satisfied);
            assertNull(sentryPart.SourceCaseExecutionId);
            assertEquals("PI_HumanTask_1", sentryPart.Source);
        }
Ejemplo n.º 5
0
 public CommandAnonymousInnerClass2(CaseSentryPartEntityTest outerInstance, CaseSentryPartEntity caseSentryPartEntity)
 {
     this.outerInstance        = outerInstance;
     this.caseSentryPartEntity = caseSentryPartEntity;
 }
Ejemplo n.º 6
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected void deleteCaseSentryPart(final org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseSentryPartEntity caseSentryPartEntity)
        protected internal virtual void deleteCaseSentryPart(CaseSentryPartEntity caseSentryPartEntity)
        {
            processEngineConfiguration.CommandExecutorTxRequired.execute(new CommandAnonymousInnerClass2(this, caseSentryPartEntity));
        }