예제 #1
0
        public virtual void testStartProcessInstanceByKeyWithoutTenantId()
        {
            deployment(PROCESS);
            deploymentForTenant(TENANT_ONE, PROCESS);

            runtimeService.createProcessInstanceByKey("testProcess").processDefinitionWithoutTenantId().execute();

            ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.singleResult().TenantId, @is(nullValue()));
        }
예제 #2
0
        public virtual void testStartProcessInstanceByKeyWithoutTenantIdNoAuthenticatedTenants()
        {
            identityService.setAuthentication("user", null, null);

            deployment(PROCESS);

            runtimeService.createProcessInstanceByKey("testProcess").processDefinitionWithoutTenantId().execute();

            ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery();

            assertThat(query.count(), @is(1L));
        }
예제 #3
0
        public virtual void testQueryByLeafInstancesOneLayer()
        {
            ProcessInstance      process = runtimeService.startProcessInstanceByKey("simpleSubProcess");
            ProcessInstanceQuery simpleSubProcessQuery = runtimeService.createProcessInstanceQuery().processDefinitionKey("simpleSubProcess");

            assertThat(runtimeService.createProcessInstanceQuery().count(), @is(1L));
            assertThat(simpleSubProcessQuery.count(), @is(1L));

            ProcessInstance instance = runtimeService.createProcessInstanceQuery().leafProcessInstances().singleResult();

            assertThat(instance.RootProcessInstanceId, @is(process.Id));
            assertThat(instance.Id, @is(simpleSubProcessQuery.singleResult().Id));
        }
예제 #4
0
        public virtual void testStartProcessInstanceByKeyWithTenantIdDisabledTenantCheck()
        {
            processEngineConfiguration.TenantCheckEnabled = false;
            identityService.setAuthentication("user", null, null);

            deploymentForTenant(TENANT_ONE, PROCESS);

            runtimeService.createProcessInstanceByKey("testProcess").processDefinitionTenantId(TENANT_ONE).execute();

            ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
        }
예제 #5
0
        public virtual void testStartProcessInstanceByKeyWithAuthenticatedTenant()
        {
            identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

            deploymentForTenant(TENANT_ONE, PROCESS);
            deploymentForTenant(TENANT_TWO, PROCESS);

            runtimeService.createProcessInstanceByKey("testProcess").execute();

            ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
        }
예제 #6
0
        public virtual void testStartProcessInstanceByIdAuthenticatedTenant()
        {
            deploymentForTenant(TENANT_ONE, PROCESS);

            ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();

            identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

            runtimeService.createProcessInstanceById(processDefinition.Id).execute();

            ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
        }
예제 #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void sendSignalToStartEventDisabledTenantCheck()
        public virtual void sendSignalToStartEventDisabledTenantCheck()
        {
            testRule.deployForTenant(TENANT_ONE, SIGNAL_START_PROCESS);
            testRule.deployForTenant(TENANT_TWO, SIGNAL_START_PROCESS);

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

            engineRule.RuntimeService.createSignalEvent("signal").send();

            ProcessInstanceQuery query = engineRule.RuntimeService.createProcessInstanceQuery();

            assertThat(query.count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(1L));
        }
예제 #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void sendSignalToStartEventWithAuthenticatedTenant()
        public virtual void sendSignalToStartEventWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, SIGNAL_START_PROCESS);
            testRule.deployForTenant(TENANT_TWO, SIGNAL_START_PROCESS);

            engineRule.IdentityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

            engineRule.RuntimeService.createSignalEvent("signal").send();

            engineRule.IdentityService.clearAuthentication();

            ProcessInstanceQuery query = engineRule.RuntimeService.createProcessInstanceQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(0L));
        }
예제 #9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void correlateMessageToStartEventNoAuthenticatedTenants()
        public virtual void correlateMessageToStartEventNoAuthenticatedTenants()
        {
            testRule.deployForTenant(TENANT_ONE, MESSAGE_START_PROCESS);
            testRule.deployForTenant(TENANT_TWO, MESSAGE_START_PROCESS);
            testRule.deploy(MESSAGE_START_PROCESS);

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

            engineRule.RuntimeService.createMessageCorrelation("message").correlateStartMessage();

            engineRule.IdentityService.clearAuthentication();

            ProcessInstanceQuery query = engineRule.RuntimeService.createProcessInstanceQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.withoutTenantId().count(), @is(1L));
        }
예제 #10
0
        public virtual void testQueryByLeafInstancesTwoLayers()
        {
            /*
             * nested structure:
             * nestedSubProcess
             * +-- subProcess
             */
            ProcessInstance      twoLayerProcess       = runtimeService.startProcessInstanceByKey("nestedSimpleSubProcess");
            ProcessInstanceQuery simpleSubProcessQuery = runtimeService.createProcessInstanceQuery().processDefinitionKey("simpleSubProcess");

            assertThat(runtimeService.createProcessInstanceQuery().count(), @is(2L));
            assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey("nestedSimpleSubProcess").count(), @is(1L));
            assertThat(simpleSubProcessQuery.count(), @is(1L));

            ProcessInstance instance = runtimeService.createProcessInstanceQuery().leafProcessInstances().singleResult();

            assertThat(instance.RootProcessInstanceId, @is(twoLayerProcess.Id));
            assertThat(instance.Id, @is(simpleSubProcessQuery.singleResult().Id));
        }