Exemplo n.º 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()));
        }
Exemplo n.º 2
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));
        }
Exemplo n.º 3
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));
        }