public ProcessDefinition build() { ProcessDefinition mockDefinition = mock(ProcessDefinition.class); when(mockDefinition.getId()).thenReturn(id); when(mockDefinition.getCategory()).thenReturn(category); when(mockDefinition.getName()).thenReturn(name); when(mockDefinition.getKey()).thenReturn(key); when(mockDefinition.getDescription()).thenReturn(description); when(mockDefinition.getVersion()).thenReturn(version); when(mockDefinition.getResourceName()).thenReturn(resource); when(mockDefinition.getDeploymentId()).thenReturn(deploymentId); when(mockDefinition.getDiagramResourceName()).thenReturn(diagram); when(mockDefinition.isSuspended()).thenReturn(suspended); when(mockDefinition.hasStartFormKey()).thenReturn(startFormKey); when(mockDefinition.getTenantId()).thenReturn(tenantId); when(mockDefinition.getVersionTag()).thenReturn(versionTag); when(mockDefinition.isStartableInTasklist()).thenReturn(isStartableInTasklist); return mockDefinition; } }
@Deployment public void testParseProcessDefinitionStartable() { List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list(); assertNotNull(processDefinitions); assertEquals(1, processDefinitions.size()); assertFalse(processDefinitions.get(0).isStartableInTasklist()); }
@Deployment public void testParseProcessDefinitionTtl() { List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list(); assertNotNull(processDefinitions); assertEquals(1, processDefinitions.size()); Integer timeToLive = processDefinitions.get(0).getHistoryTimeToLive(); assertNotNull(timeToLive); assertEquals(5, timeToLive.intValue()); assertTrue(processDefinitions.get(0).isStartableInTasklist()); }
public static ProcessDefinitionDto fromProcessDefinition(ProcessDefinition definition) { ProcessDefinitionDto dto = new ProcessDefinitionDto(); dto.id = definition.getId(); dto.key = definition.getKey(); dto.category = definition.getCategory(); dto.description = definition.getDescription(); dto.name = definition.getName(); dto.version = definition.getVersion(); dto.resource = definition.getResourceName(); dto.deploymentId = definition.getDeploymentId(); dto.diagram = definition.getDiagramResourceName(); dto.suspended = definition.isSuspended(); dto.tenantId = definition.getTenantId(); dto.versionTag = definition.getVersionTag(); dto.historyTimeToLive = definition.getHistoryTimeToLive(); dto.isStartableInTasklist = definition.isStartableInTasklist(); return dto; }
public static ProcessDefinitionDto fromProcessDefinition(ProcessDefinition definition) { ProcessDefinitionDto dto = new ProcessDefinitionDto(); dto.id = definition.getId(); dto.key = definition.getKey(); dto.category = definition.getCategory(); dto.description = definition.getDescription(); dto.name = definition.getName(); dto.version = definition.getVersion(); dto.resource = definition.getResourceName(); dto.deploymentId = definition.getDeploymentId(); dto.diagram = definition.getDiagramResourceName(); dto.suspended = definition.isSuspended(); dto.tenantId = definition.getTenantId(); dto.versionTag = definition.getVersionTag(); dto.historyTimeToLive = definition.getHistoryTimeToLive(); dto.isStartableInTasklist = definition.isStartableInTasklist(); return dto; }
public void testStartableInTasklist() { // given createGrantAuthorization(PROCESS_DEFINITION, ONE_TASK_PROCESS_KEY, userId, READ, CREATE_INSTANCE); createGrantAuthorization(PROCESS_INSTANCE, "*", userId, CREATE); final ProcessDefinition definition = selectProcessDefinitionByKey(ONE_TASK_PROCESS_KEY); // when List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().startablePermissionCheck().startableInTasklist().list(); // then assertNotNull(processDefinitions); assertEquals(1, repositoryService.createProcessDefinitionQuery().startablePermissionCheck().startableInTasklist().count()); assertEquals(definition.getId(), processDefinitions.get(0).getId()); assertTrue(processDefinitions.get(0).isStartableInTasklist()); }
public void testStartableInTasklistReadAllProcessDefinition() { // given createGrantAuthorization(PROCESS_DEFINITION, "*", userId, READ); createGrantAuthorization(PROCESS_DEFINITION, ONE_TASK_PROCESS_KEY, userId, CREATE_INSTANCE); createGrantAuthorization(PROCESS_INSTANCE, "*", userId, CREATE); final ProcessDefinition definition = selectProcessDefinitionByKey(ONE_TASK_PROCESS_KEY); // when List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().startablePermissionCheck().startableInTasklist().list(); // then assertNotNull(processDefinitions); assertEquals(1, repositoryService.createProcessDefinitionQuery().startablePermissionCheck().startableInTasklist().count()); assertEquals(definition.getId(), processDefinitions.get(0).getId()); assertTrue(processDefinitions.get(0).isStartableInTasklist()); }
@Deployment public void testParseProcessDefinitionStartable() { List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list(); assertNotNull(processDefinitions); assertEquals(1, processDefinitions.size()); assertFalse(processDefinitions.get(0).isStartableInTasklist()); }
@Deployment public void testParseProcessDefinitionTtl() { List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().list(); assertNotNull(processDefinitions); assertEquals(1, processDefinitions.size()); Integer timeToLive = processDefinitions.get(0).getHistoryTimeToLive(); assertNotNull(timeToLive); assertEquals(5, timeToLive.intValue()); assertTrue(processDefinitions.get(0).isStartableInTasklist()); }
public static ProcessDefinitionDto fromProcessDefinition(ProcessDefinition definition) { ProcessDefinitionDto dto = new ProcessDefinitionDto(); dto.id = definition.getId(); dto.key = definition.getKey(); dto.category = definition.getCategory(); dto.description = definition.getDescription(); dto.name = definition.getName(); dto.version = definition.getVersion(); dto.resource = definition.getResourceName(); dto.deploymentId = definition.getDeploymentId(); dto.diagram = definition.getDiagramResourceName(); dto.suspended = definition.isSuspended(); dto.tenantId = definition.getTenantId(); dto.versionTag = definition.getVersionTag(); dto.historyTimeToLive = definition.getHistoryTimeToLive(); dto.isStartableInTasklist = definition.isStartableInTasklist(); return dto; }
public void testStartableInTasklist() { // given createGrantAuthorization(PROCESS_DEFINITION, ONE_TASK_PROCESS_KEY, userId, READ, CREATE_INSTANCE); createGrantAuthorization(PROCESS_INSTANCE, "*", userId, CREATE); final ProcessDefinition definition = selectProcessDefinitionByKey(ONE_TASK_PROCESS_KEY); // when List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().startablePermissionCheck().startableInTasklist().list(); // then assertNotNull(processDefinitions); assertEquals(1, repositoryService.createProcessDefinitionQuery().startablePermissionCheck().startableInTasklist().count()); assertEquals(definition.getId(), processDefinitions.get(0).getId()); assertTrue(processDefinitions.get(0).isStartableInTasklist()); }
public void testStartableInTasklistReadAllProcessDefinition() { // given createGrantAuthorization(PROCESS_DEFINITION, "*", userId, READ); createGrantAuthorization(PROCESS_DEFINITION, ONE_TASK_PROCESS_KEY, userId, CREATE_INSTANCE); createGrantAuthorization(PROCESS_INSTANCE, "*", userId, CREATE); final ProcessDefinition definition = selectProcessDefinitionByKey(ONE_TASK_PROCESS_KEY); // when List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().startablePermissionCheck().startableInTasklist().list(); // then assertNotNull(processDefinitions); assertEquals(1, repositoryService.createProcessDefinitionQuery().startablePermissionCheck().startableInTasklist().count()); assertEquals(definition.getId(), processDefinitions.get(0).getId()); assertTrue(processDefinitions.get(0).isStartableInTasklist()); }