Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void suspendProcessInstanceIncludingExternalTaskForNonTenant()
        public virtual void suspendProcessInstanceIncludingExternalTaskForNonTenant()
        {
            // given activated external tasks
            ExternalTaskQuery query = engineRule.ExternalTaskService.createExternalTaskQuery();

            assertThat(query.active().count(), @is(3L));
            assertThat(query.suspended().count(), @is(0L));

            engineRule.RuntimeService.updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionWithoutTenantId().suspend();

            assertThat(query.active().count(), @is(2L));
            assertThat(query.suspended().count(), @is(1L));
            assertThat(query.suspended().singleResult().TenantId, @is(nullValue()));
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void activateProcessInstanceIncludingExternalTaskForTenant()
        public virtual void activateProcessInstanceIncludingExternalTaskForTenant()
        {
            // given suspended external tasks
            engineRule.RuntimeService.updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();

            ExternalTaskQuery query = engineRule.ExternalTaskService.createExternalTaskQuery();

            assertThat(query.active().count(), @is(0L));
            assertThat(query.suspended().count(), @is(3L));

            engineRule.RuntimeService.updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionTenantId(TENANT_ONE).activate();

            assertThat(query.suspended().count(), @is(2L));
            assertThat(query.active().count(), @is(1L));
            assertThat(query.active().tenantIdIn(TENANT_ONE).count(), @is(1L));
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void suspendAndActivateProcessInstancesIncludingExternalTasksForAllTenants()
        public virtual void suspendAndActivateProcessInstancesIncludingExternalTasksForAllTenants()
        {
            // given activated external tasks
            ExternalTaskQuery query = engineRule.ExternalTaskService.createExternalTaskQuery();

            assertThat(query.active().count(), @is(3L));
            assertThat(query.suspended().count(), @is(0L));

            // first suspend
            engineRule.RuntimeService.updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();

            assertThat(query.active().count(), @is(0L));
            assertThat(query.suspended().count(), @is(3L));

            // then activate
            engineRule.RuntimeService.updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).activate();

            assertThat(query.active().count(), @is(3L));
            assertThat(query.suspended().count(), @is(0L));
        }