Ejemplo n.º 1
0
        public virtual void testStartProcessInstanceWithVersionBinding()
        {
            deploymentForTenant(TENANT_ONE, CMMN_VERSION, PROCESS);
            deploymentForTenant(TENANT_TWO, CMMN_VERSION, PROCESS);

            createCaseInstance("testCaseVersion", TENANT_ONE);
            createCaseInstance("testCaseVersion", TENANT_TWO);

            ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().processDefinitionKey("testProcess");

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

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

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

            ProcessInstanceQuery query = engineRule.RuntimeService.createProcessInstanceQuery();

            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(0L));
        }
Ejemplo n.º 3
0
        public virtual void testStartProcessInstanceWithVersionBinding()
        {
            BpmnModelInstance callingProcess = Bpmn.createExecutableProcess("callingProcess").startEvent().callActivity().calledElement("subProcess").camundaCalledElementBinding("version").camundaCalledElementVersion("1").endEvent().done();

            deploymentForTenant(TENANT_ONE, callingProcess, SUB_PROCESS);
            deploymentForTenant(TENANT_TWO, callingProcess, SUB_PROCESS);

            runtimeService.createProcessInstanceByKey("callingProcess").processDefinitionTenantId(TENANT_ONE).execute();
            runtimeService.createProcessInstanceByKey("callingProcess").processDefinitionTenantId(TENANT_TWO).execute();

            ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().processDefinitionKey("subProcess");

            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(1L));
        }
Ejemplo n.º 4
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));
        }
Ejemplo n.º 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void correlateMessageToStartEventWithAuthenticatedTenant()
        public virtual void correlateMessageToStartEventWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, MESSAGE_START_PROCESS);
            testRule.deployForTenant(TENANT_TWO, MESSAGE_START_PROCESS);

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

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

            engineRule.IdentityService.clearAuthentication();

            ProcessInstanceQuery query = engineRule.RuntimeService.createProcessInstanceQuery();

            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(0L));
        }
Ejemplo n.º 6
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));
        }
Ejemplo n.º 7
0
        public virtual void testStartProcessInstanceWithLatestBindingDifferentVersion()
        {
            deploymentForTenant(TENANT_ONE, CMMN_LATEST_WITH_MANUAL_ACTIVATION, PROCESS);

            deploymentForTenant(TENANT_TWO, CMMN_LATEST_WITH_MANUAL_ACTIVATION, PROCESS);
            deploymentForTenant(TENANT_TWO, PROCESS);

            createCaseInstance("testCase", TENANT_ONE);
            createCaseInstance("testCase", TENANT_TWO);

            ProcessDefinition latestProcessTenantTwo = repositoryService.createProcessDefinitionQuery().tenantIdIn(TENANT_TWO).processDefinitionKey("testProcess").latestVersion().singleResult();

            ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().processDefinitionKey("testProcess");

            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).processDefinitionId(latestProcessTenantTwo.Id).count(), @is(1L));
        }
Ejemplo n.º 8
0
        public virtual void testStartProcessInstanceWithLatestBindingDifferentVersion()
        {
            BpmnModelInstance callingProcess = Bpmn.createExecutableProcess("callingProcess").startEvent().callActivity().calledElement("subProcess").camundaCalledElementBinding("latest").endEvent().done();

            deploymentForTenant(TENANT_ONE, callingProcess, SUB_PROCESS);

            deploymentForTenant(TENANT_TWO, callingProcess, SUB_PROCESS);
            deploymentForTenant(TENANT_TWO, SUB_PROCESS);

            runtimeService.createProcessInstanceByKey("callingProcess").processDefinitionTenantId(TENANT_ONE).execute();
            runtimeService.createProcessInstanceByKey("callingProcess").processDefinitionTenantId(TENANT_TWO).execute();

            ProcessDefinition latestSubProcessTenantTwo = repositoryService.createProcessDefinitionQuery().tenantIdIn(TENANT_TWO).processDefinitionKey("subProcess").latestVersion().singleResult();

            ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().processDefinitionKey("subProcess");

            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).processDefinitionId(latestSubProcessTenantTwo.Id).count(), @is(1L));
        }
Ejemplo n.º 9
0
        public virtual void testProcessRefTenantIdConstant()
        {
            deployment(CMMN_TENANT_CONST);
            deploymentForTenant(TENANT_ONE, PROCESS);

            caseService.withCaseDefinitionByKey("testCase").create();

            ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().processDefinitionKey("testProcess");

            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
        }
Ejemplo n.º 10
0
        public virtual void testCalledElementTenantIdExpression()
        {
            BpmnModelInstance callingProcess = Bpmn.createExecutableProcess("callingProcess").startEvent().callActivity().calledElement("subProcess").camundaCalledElementTenantId("${'" + TENANT_ONE + "'}").endEvent().done();

            deploymentForTenant(TENANT_ONE, SUB_PROCESS);
            deployment(callingProcess);

            runtimeService.startProcessInstanceByKey("callingProcess");

            ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().processDefinitionKey("subProcess");

            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
        }
Ejemplo n.º 11
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));
        }
Ejemplo n.º 12
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));
        }
Ejemplo n.º 13
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));
        }
Ejemplo n.º 14
0
        public virtual void testProcessRefTenantIdExpression()
        {
            deployment(CMMN_TENANT_EXPR);
            deploymentForTenant(TENANT_ONE, PROCESS);

            caseService.withCaseDefinitionByKey("testCase").create();

            CaseExecution caseExecution = caseService.createCaseExecutionQuery().activityId(PROCESS_TASK_ID).singleResult();

            caseService.withCaseExecution(caseExecution.Id).manualStart();

            ProcessInstanceQuery query = runtimeService.createProcessInstanceQuery().processDefinitionKey("testProcess");

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