@Override public void checkReadCaseInstance(CaseExecution caseExecution) { if (caseExecution != null && !getTenantManager().isAuthenticatedTenant(caseExecution.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("get the case execution '" + caseExecution.getId() + "'"); } }
@Override public void checkUpdateCaseInstance(CaseExecution caseExecution) { if (caseExecution != null && !getTenantManager().isAuthenticatedTenant(caseExecution.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("update the case execution '" + caseExecution.getId() + "'"); } }
@Override public void checkReadCaseInstance(CaseExecution caseExecution) { if (caseExecution != null && !getTenantManager().isAuthenticatedTenant(caseExecution.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("get the case execution '" + caseExecution.getId() + "'"); } }
@Override public void checkUpdateCaseInstance(CaseExecution caseExecution) { if (caseExecution != null && !getTenantManager().isAuthenticatedTenant(caseExecution.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("update the case execution '" + caseExecution.getId() + "'"); } }
public void testQuerySortingDesc() { // exclude case executions without tenant id because of database-specific ordering List<CaseExecution> caseExecutions = caseService.createCaseExecutionQuery() .tenantIdIn(TENANT_ONE, TENANT_TWO) .orderByTenantId() .desc() .list(); assertThat(caseExecutions.size(), is(4)); assertThat(caseExecutions.get(0).getTenantId(), is(TENANT_TWO)); assertThat(caseExecutions.get(1).getTenantId(), is(TENANT_TWO)); assertThat(caseExecutions.get(2).getTenantId(), is(TENANT_ONE)); assertThat(caseExecutions.get(3).getTenantId(), is(TENANT_ONE)); }
public void testQuerySortingAsc() { // exclude case executions without tenant id because of database-specific ordering List<CaseExecution> caseExecutions = caseService.createCaseExecutionQuery() .tenantIdIn(TENANT_ONE, TENANT_TWO) .orderByTenantId() .asc() .list(); assertThat(caseExecutions.size(), is(4)); assertThat(caseExecutions.get(0).getTenantId(), is(TENANT_ONE)); assertThat(caseExecutions.get(1).getTenantId(), is(TENANT_ONE)); assertThat(caseExecutions.get(2).getTenantId(), is(TENANT_TWO)); assertThat(caseExecutions.get(3).getTenantId(), is(TENANT_TWO)); }
public static CaseExecution createMockCaseExecution(String tenantId) { CaseExecution mock = mock(CaseExecution.class); when(mock.getId()).thenReturn(EXAMPLE_CASE_EXECUTION_ID); when(mock.getCaseInstanceId()).thenReturn(EXAMPLE_CASE_EXECUTION_CASE_INSTANCE_ID); when(mock.getParentId()).thenReturn(EXAMPLE_CASE_EXECUTION_PARENT_ID); when(mock.getCaseDefinitionId()).thenReturn(EXAMPLE_CASE_EXECUTION_CASE_DEFINITION_ID); when(mock.getActivityId()).thenReturn(EXAMPLE_CASE_EXECUTION_ACTIVITY_ID); when(mock.getActivityName()).thenReturn(EXAMPLE_CASE_EXECUTION_ACTIVITY_NAME); when(mock.getActivityType()).thenReturn(EXAMPLE_CASE_EXECUTION_ACTIVITY_TYPE); when(mock.getActivityDescription()).thenReturn(EXAMPLE_CASE_EXECUTION_ACTIVITY_DESCRIPTION); when(mock.getTenantId()).thenReturn(tenantId); when(mock.isRequired()).thenReturn(EXAMPLE_CASE_EXECUTION_IS_REQUIRED); when(mock.isActive()).thenReturn(EXAMPLE_CASE_EXECUTION_IS_ACTIVE); when(mock.isEnabled()).thenReturn(EXAMPLE_CASE_EXECUTION_IS_ENABLED); when(mock.isDisabled()).thenReturn(EXAMPLE_CASE_EXECUTION_IS_DISABLED); return mock; }
public static CaseExecutionDto fromCaseExecution(CaseExecution caseExecution) { CaseExecutionDto dto = new CaseExecutionDto(); dto.id = caseExecution.getId(); dto.caseInstanceId = caseExecution.getCaseInstanceId(); dto.caseDefinitionId = caseExecution.getCaseDefinitionId(); dto.activityId = caseExecution.getActivityId(); dto.activityName = caseExecution.getActivityName(); dto.activityType = caseExecution.getActivityType(); dto.activityDescription = caseExecution.getActivityDescription(); dto.parentId = caseExecution.getParentId(); dto.tenantId = caseExecution.getTenantId(); dto.required = caseExecution.isRequired(); dto.active = caseExecution.isActive(); dto.enabled = caseExecution.isEnabled(); dto.disabled = caseExecution.isDisabled(); return dto; }
public static CaseExecutionDto fromCaseExecution(CaseExecution caseExecution) { CaseExecutionDto dto = new CaseExecutionDto(); dto.id = caseExecution.getId(); dto.caseInstanceId = caseExecution.getCaseInstanceId(); dto.caseDefinitionId = caseExecution.getCaseDefinitionId(); dto.activityId = caseExecution.getActivityId(); dto.activityName = caseExecution.getActivityName(); dto.activityType = caseExecution.getActivityType(); dto.activityDescription = caseExecution.getActivityDescription(); dto.parentId = caseExecution.getParentId(); dto.tenantId = caseExecution.getTenantId(); dto.required = caseExecution.isRequired(); dto.active = caseExecution.isActive(); dto.enabled = caseExecution.isEnabled(); dto.disabled = caseExecution.isDisabled(); return dto; }
@Override public void checkReadCaseInstance(CaseExecution caseExecution) { if (caseExecution != null && !getTenantManager().isAuthenticatedTenant(caseExecution.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("get the case execution '" + caseExecution.getId() + "'"); } }
@Override public void checkUpdateCaseInstance(CaseExecution caseExecution) { if (caseExecution != null && !getTenantManager().isAuthenticatedTenant(caseExecution.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("update the case execution '" + caseExecution.getId() + "'"); } }
public void testQuerySortingDesc() { // exclude case executions without tenant id because of database-specific ordering List<CaseExecution> caseExecutions = caseService.createCaseExecutionQuery() .tenantIdIn(TENANT_ONE, TENANT_TWO) .orderByTenantId() .desc() .list(); assertThat(caseExecutions.size(), is(4)); assertThat(caseExecutions.get(0).getTenantId(), is(TENANT_TWO)); assertThat(caseExecutions.get(1).getTenantId(), is(TENANT_TWO)); assertThat(caseExecutions.get(2).getTenantId(), is(TENANT_ONE)); assertThat(caseExecutions.get(3).getTenantId(), is(TENANT_ONE)); }
public void testQuerySortingAsc() { // exclude case executions without tenant id because of database-specific ordering List<CaseExecution> caseExecutions = caseService.createCaseExecutionQuery() .tenantIdIn(TENANT_ONE, TENANT_TWO) .orderByTenantId() .asc() .list(); assertThat(caseExecutions.size(), is(4)); assertThat(caseExecutions.get(0).getTenantId(), is(TENANT_ONE)); assertThat(caseExecutions.get(1).getTenantId(), is(TENANT_ONE)); assertThat(caseExecutions.get(2).getTenantId(), is(TENANT_TWO)); assertThat(caseExecutions.get(3).getTenantId(), is(TENANT_TWO)); }
public static CaseExecutionDto fromCaseExecution(CaseExecution caseExecution) { CaseExecutionDto dto = new CaseExecutionDto(); dto.id = caseExecution.getId(); dto.caseInstanceId = caseExecution.getCaseInstanceId(); dto.caseDefinitionId = caseExecution.getCaseDefinitionId(); dto.activityId = caseExecution.getActivityId(); dto.activityName = caseExecution.getActivityName(); dto.activityType = caseExecution.getActivityType(); dto.activityDescription = caseExecution.getActivityDescription(); dto.parentId = caseExecution.getParentId(); dto.tenantId = caseExecution.getTenantId(); dto.required = caseExecution.isRequired(); dto.active = caseExecution.isActive(); dto.enabled = caseExecution.isEnabled(); dto.disabled = caseExecution.isDisabled(); return dto; }