예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void suspendProcessInstanceForNonTenant()
        public virtual void suspendProcessInstanceForNonTenant()
        {
            // given activated process instances
            ProcessInstanceQuery query = engineRule.RuntimeService.createProcessInstanceQuery();

            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().withoutTenantId().count(), @is(1L));
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void suspendProcessInstanceDisabledTenantCheck()
        public virtual void suspendProcessInstanceDisabledTenantCheck()
        {
            // given activated process instances
            ProcessInstanceQuery query = engineRule.RuntimeService.createProcessInstanceQuery();

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

            engineRule.ProcessEngineConfiguration.TenantCheckEnabled = false;
            engineRule.IdentityService.setAuthentication("user", null, null);

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

            assertThat(query.active().count(), @is(0L));
            assertThat(query.suspended().count(), @is(3L));
            assertThat(query.suspended().tenantIdIn(TENANT_ONE, TENANT_TWO).count(), @is(2L));
            assertThat(query.suspended().withoutTenantId().count(), @is(1L));
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void suspendProcessInstanceNoAuthenticatedTenants()
        public virtual void suspendProcessInstanceNoAuthenticatedTenants()
        {
            // given activated process instances
            ProcessInstanceQuery query = engineRule.RuntimeService.createProcessInstanceQuery();

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

            engineRule.IdentityService.setAuthentication("user", null, null);

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

            engineRule.IdentityService.clearAuthentication();

            assertThat(query.active().count(), @is(2L));
            assertThat(query.suspended().count(), @is(1L));
            assertThat(query.suspended().withoutTenantId().count(), @is(1L));
        }
예제 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void suspendAndActivateProcessInstancesForAllTenants()
        public virtual void suspendAndActivateProcessInstancesForAllTenants()
        {
            // given activated process instances
            ProcessInstanceQuery query = engineRule.RuntimeService.createProcessInstanceQuery();

            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));
        }
예제 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void suspendProcessDefinitionByIdIncludeInstancesFromAllTenants()
        public virtual void suspendProcessDefinitionByIdIncludeInstancesFromAllTenants()
        {
            // given active process instances with tenant id of process definition without tenant id
            engineRule.RuntimeService.createProcessInstanceByKey(PROCESS_DEFINITION_KEY).processDefinitionWithoutTenantId().execute();

            ProcessDefinition processDefinition = engineRule.RepositoryService.createProcessDefinitionQuery().withoutTenantId().singleResult();

            ProcessInstanceQuery query = engineRule.RuntimeService.createProcessInstanceQuery().processDefinitionId(processDefinition.Id);

            assertThat(query.active().count(), @is(1L));
            assertThat(query.active().tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.suspended().count(), @is(0L));

            // suspend all instances of process definition
            engineRule.RepositoryService.updateProcessDefinitionSuspensionState().byProcessDefinitionId(processDefinition.Id).includeProcessInstances(true).suspend();

            assertThat(query.active().count(), @is(0L));
            assertThat(query.suspended().count(), @is(1L));
            assertThat(query.suspended().tenantIdIn(TENANT_ONE).count(), @is(1L));
        }