public String getTenantId() { return wrappedExecution.getTenantId(); }
public static Execution createMockExecution(String tenantId) { Execution mock = mock(Execution.class); when(mock.getId()).thenReturn(EXAMPLE_EXECUTION_ID); when(mock.getProcessInstanceId()).thenReturn(EXAMPLE_PROCESS_INSTANCE_ID); when(mock.isEnded()).thenReturn(EXAMPLE_EXECUTION_IS_ENDED); when(mock.getTenantId()).thenReturn(tenantId); return mock; }
public static ExecutionDto fromExecution(Execution execution) { ExecutionDto dto = new ExecutionDto(); dto.id = execution.getId(); dto.processInstanceId = execution.getProcessInstanceId(); dto.ended = execution.isEnded(); dto.tenantId = execution.getTenantId(); return dto; }
public static ExecutionDto fromExecution(Execution execution) { ExecutionDto dto = new ExecutionDto(); dto.id = execution.getId(); dto.processInstanceId = execution.getProcessInstanceId(); dto.ended = execution.isEnded(); dto.tenantId = execution.getTenantId(); return dto; }
public void testQuerySortingDesc() { // exclude executions without tenant id because of database-specific ordering List<Execution> executions = runtimeService.createExecutionQuery() .tenantIdIn(TENANT_ONE, TENANT_TWO) .orderByTenantId() .desc() .list(); assertThat(executions.size(), is(2)); assertThat(executions.get(0).getTenantId(), is(TENANT_TWO)); assertThat(executions.get(1).getTenantId(), is(TENANT_ONE)); }
public void testQuerySortingAsc() { // exclude executions without tenant id because of database-specific ordering List<Execution> executions = runtimeService.createExecutionQuery() .tenantIdIn(TENANT_ONE, TENANT_TWO) .orderByTenantId() .asc() .list(); assertThat(executions.size(), is(2)); assertThat(executions.get(0).getTenantId(), is(TENANT_ONE)); assertThat(executions.get(1).getTenantId(), is(TENANT_TWO)); }
public void testPropagateTenantIdToConcurrentExecution() { deploymentForTenant(TENANT_ID, Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY) .startEvent() .parallelGateway("fork") .userTask() .parallelGateway("join") .endEvent() .moveToNode("fork") .userTask() .connectTo("join") .done()); startProcessInstance(PROCESS_DEFINITION_KEY); List<Execution> executions = runtimeService.createExecutionQuery().list(); assertThat(executions.size(), is(3)); assertThat(executions.get(0).getTenantId(), is(TENANT_ID)); // inherit the tenant id from process instance assertThat(executions.get(1).getTenantId(), is(TENANT_ID)); assertThat(executions.get(2).getTenantId(), is(TENANT_ID)); }
public void testPropagateTenantIdToEmbeddedSubprocess() { deploymentForTenant(TENANT_ID, Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY) .startEvent() .subProcess() .embeddedSubProcess() .startEvent() .userTask() .endEvent() .subProcessDone() .endEvent() .done()); startProcessInstance(PROCESS_DEFINITION_KEY); List<Execution> executions = runtimeService.createExecutionQuery().list(); assertThat(executions.size(), is(2)); assertThat(executions.get(0).getTenantId(), is(TENANT_ID)); // inherit the tenant id from parent execution (e.g. process instance) assertThat(executions.get(1).getTenantId(), is(TENANT_ID)); }
public String getTenantId() { return wrappedExecution.getTenantId(); }
public static ExecutionDto fromExecution(Execution execution) { ExecutionDto dto = new ExecutionDto(); dto.id = execution.getId(); dto.processInstanceId = execution.getProcessInstanceId(); dto.ended = execution.isEnded(); dto.tenantId = execution.getTenantId(); return dto; }
public void testQuerySortingDesc() { // exclude executions without tenant id because of database-specific ordering List<Execution> executions = runtimeService.createExecutionQuery() .tenantIdIn(TENANT_ONE, TENANT_TWO) .orderByTenantId() .desc() .list(); assertThat(executions.size(), is(2)); assertThat(executions.get(0).getTenantId(), is(TENANT_TWO)); assertThat(executions.get(1).getTenantId(), is(TENANT_ONE)); }
public void testQuerySortingAsc() { // exclude executions without tenant id because of database-specific ordering List<Execution> executions = runtimeService.createExecutionQuery() .tenantIdIn(TENANT_ONE, TENANT_TWO) .orderByTenantId() .asc() .list(); assertThat(executions.size(), is(2)); assertThat(executions.get(0).getTenantId(), is(TENANT_ONE)); assertThat(executions.get(1).getTenantId(), is(TENANT_TWO)); }
public void testPropagateTenantIdToConcurrentExecution() { deploymentForTenant(TENANT_ID, Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY) .startEvent() .parallelGateway("fork") .userTask() .parallelGateway("join") .endEvent() .moveToNode("fork") .userTask() .connectTo("join") .done()); startProcessInstance(PROCESS_DEFINITION_KEY); List<Execution> executions = runtimeService.createExecutionQuery().list(); assertThat(executions.size(), is(3)); assertThat(executions.get(0).getTenantId(), is(TENANT_ID)); // inherit the tenant id from process instance assertThat(executions.get(1).getTenantId(), is(TENANT_ID)); assertThat(executions.get(2).getTenantId(), is(TENANT_ID)); }
public void testPropagateTenantIdToEmbeddedSubprocess() { deploymentForTenant(TENANT_ID, Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY) .startEvent() .subProcess() .embeddedSubProcess() .startEvent() .userTask() .endEvent() .subProcessDone() .endEvent() .done()); startProcessInstance(PROCESS_DEFINITION_KEY); List<Execution> executions = runtimeService.createExecutionQuery().list(); assertThat(executions.size(), is(2)); assertThat(executions.get(0).getTenantId(), is(TENANT_ID)); // inherit the tenant id from parent execution (e.g. process instance) assertThat(executions.get(1).getTenantId(), is(TENANT_ID)); }