@Override protected void executeImpl(Action action, NodeRef actionedUponNodeRef) { @SuppressWarnings("unchecked") List<String> workflowIds = (List<String>) action.getParameterValue(PARAM_WORKFLOW_ID_LIST); if (log.isTraceEnabled()) { log.trace("Cancelling " + (workflowIds == null ? 0 : workflowIds.size()) + " workflows by ID."); } if (workflowIds != null && !workflowIds.isEmpty()) { this.workflowService.cancelWorkflows(workflowIds); } }
@Override protected void executeImpl(Action action, NodeRef actionedUponNodeRef) { @SuppressWarnings("unchecked") List<String> workflowIds = (List<String>) action.getParameterValue(PARAM_WORKFLOW_ID_LIST); if (log.isTraceEnabled()) { log.trace("Cancelling " + (workflowIds == null ? 0 : workflowIds.size()) + " workflows by ID."); } if (workflowIds != null && !workflowIds.isEmpty()) { this.workflowService.cancelWorkflows(workflowIds); } }
@Test public void testWorkflowVarious() throws Exception { WorkflowDefinition definition = deployDefinition(getTestDefinitionPath()); // Start the Workflow WorkflowPath path = workflowService.startWorkflow(definition.getId(), null); String instanceId = path.getInstance().getId(); List<WorkflowTask> workflowTasks = workflowService.getStartTasks(Arrays.asList(instanceId), true); assertNotNull(workflowTasks); assertEquals(1, workflowTasks.size()); assertFalse(workflowService.hasWorkflowImage(instanceId)); assertNull(workflowService.getWorkflowImage(instanceId)); List<WorkflowInstance> instances = workflowService.cancelWorkflows(null); assertTrue(instances.isEmpty()); WorkflowInstance wfi = workflowService.deleteWorkflow(instanceId); assertEquals(instanceId, wfi.getId()); try { byte[] image = workflowService.getDefinitionImage(definition.getId()); } catch (WorkflowException we ) { assertTrue(we.getMessage().contains("Failed to retrieve workflow definition")); } }