コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void correlateMessageByProcessDefinitionIdWithAuthenticatedTenant()
        public virtual void correlateMessageByProcessDefinitionIdWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, MESSAGE_START_PROCESS);

            ProcessDefinition processDefinition = engineRule.RepositoryService.createProcessDefinitionQuery().processDefinitionKey("messageStart").singleResult();

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

            engineRule.RuntimeService.createMessageCorrelation("message").processDefinitionId(processDefinition.Id).correlateStartMessage();

            engineRule.IdentityService.clearAuthentication();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_ONE).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 correlateMessageByProcessInstanceIdWithAuthenticatedTenant()
        public virtual void correlateMessageByProcessInstanceIdWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, MESSAGE_CATCH_PROCESS);

            ProcessInstance processInstance = engineRule.RuntimeService.createProcessInstanceByKey("messageCatch").execute();

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

            engineRule.RuntimeService.createMessageCorrelation("message").processInstanceId(processInstance.Id).correlate();

            engineRule.IdentityService.clearAuthentication();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_ONE).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 signalIntermediateCatchEventWithAuthenticatedTenant()
        public virtual void signalIntermediateCatchEventWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, SIGNAL_CATCH_PROCESS);

            engineRule.RuntimeService.createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_ONE).execute();

            Execution execution = engineRule.RuntimeService.createExecutionQuery().processDefinitionKey("signalCatch").signalEventSubscriptionName("signal").singleResult();

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

            engineRule.RuntimeService.signal(execution.Id, "signal", null, null);

            engineRule.IdentityService.clearAuthentication();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_ONE).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 sendSignalToStartAndIntermediateCatchEventDisabledTenantCheck()
        public virtual void sendSignalToStartAndIntermediateCatchEventDisabledTenantCheck()
        {
            testRule.deployForTenant(TENANT_ONE, SIGNAL_START_PROCESS, SIGNAL_CATCH_PROCESS);
            testRule.deployForTenant(TENANT_TWO, SIGNAL_START_PROCESS, SIGNAL_CATCH_PROCESS);

            engineRule.RuntimeService.createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_ONE).execute();
            engineRule.RuntimeService.createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_TWO).execute();

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

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

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(4L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(2L));
        }
コード例 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void correlateReceivedMessageToIntermediateCatchEventWithAuthenticatedTenant()
        public virtual void correlateReceivedMessageToIntermediateCatchEventWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, MESSAGE_CATCH_PROCESS);

            engineRule.RuntimeService.createProcessInstanceByKey("messageCatch").execute();

            Execution execution = engineRule.RuntimeService.createExecutionQuery().processDefinitionKey("messageCatch").messageEventSubscriptionName("message").singleResult();

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

            engineRule.RuntimeService.messageEventReceived("message", execution.Id);

            engineRule.IdentityService.clearAuthentication();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

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

            engineRule.RuntimeService.createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_ONE).execute();
            engineRule.RuntimeService.createProcessInstanceByKey("signalCatch").processDefinitionTenantId(TENANT_TWO).execute();

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

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

            engineRule.IdentityService.clearAuthentication();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(0L));
        }
コード例 #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void correlateMessageToStartAndIntermediateCatchEventWithNoAuthenticatedTenants()
        public virtual void correlateMessageToStartAndIntermediateCatchEventWithNoAuthenticatedTenants()
        {
            testRule.deploy(MESSAGE_START_PROCESS, MESSAGE_CATCH_PROCESS);
            testRule.deployForTenant(TENANT_ONE, MESSAGE_START_PROCESS, MESSAGE_CATCH_PROCESS);

            engineRule.RuntimeService.createProcessInstanceByKey("messageCatch").processDefinitionWithoutTenantId().execute();
            engineRule.RuntimeService.createProcessInstanceByKey("messageCatch").processDefinitionTenantId(TENANT_ONE).execute();

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

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

            engineRule.IdentityService.clearAuthentication();

            TaskQuery query = engineRule.TaskService.createTaskQuery();

            assertThat(query.count(), @is(2L));
            assertThat(query.withoutTenantId().count(), @is(2L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(0L));
        }
コード例 #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void correlateReceivedMessageToIntermediateCatchEventDisabledTenantCheck()
        public virtual void correlateReceivedMessageToIntermediateCatchEventDisabledTenantCheck()
        {
            testRule.deployForTenant(TENANT_ONE, MESSAGE_CATCH_PROCESS);
            testRule.deployForTenant(TENANT_TWO, MESSAGE_CATCH_PROCESS);

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

            engineRule.RuntimeService.createProcessInstanceByKey("messageCatch").processDefinitionTenantId(TENANT_ONE).execute();
            engineRule.RuntimeService.createProcessInstanceByKey("messageCatch").processDefinitionTenantId(TENANT_TWO).execute();

            Execution execution = engineRule.RuntimeService.createExecutionQuery().processDefinitionKey("messageCatch").messageEventSubscriptionName("message").tenantIdIn(TENANT_ONE).singleResult();

            engineRule.RuntimeService.messageEventReceived("message", execution.Id);

            TaskQuery query = engineRule.TaskService.createTaskQuery();

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