/** * Pauses the workflow given a worklfowId. * @param workflowId WorkflowId of the workflow. */ @Service public void pauseWorkflow(String workflowId) { workflowExecutor.pauseWorkflow(workflowId); }
/** * Pause the list of workflows. * @param workflowIds - list of workflow Ids to perform pause operation on * @return bulk response object containing a list of succeeded workflows and a list of failed ones with errors */ @Service public BulkResponse pauseWorkflow(List<String> workflowIds){ for (String workflowId : workflowIds) { workflowExecutor.pauseWorkflow(workflowId); } BulkResponse bulkResponse = new BulkResponse(); for (String workflowId : workflowIds) { try { workflowExecutor.pauseWorkflow(workflowId); bulkResponse.appendSuccessResponse(workflowId); } catch (Exception e) { LOGGER.error("bulk pauseWorkflow exception, workflowId {}, message: {} ",workflowId, e.getMessage(), e); bulkResponse.appendFailedResponse(workflowId, e.getMessage()); } } return bulkResponse; }
@Test public void testPauseWorkflow() { workflowService.pauseWorkflow("test"); verify(mockWorkflowExecutor, times(1)).pauseWorkflow(anyString()); }
workflowExecutor.pauseWorkflow(wfid);
/** * Pauses the workflow given a worklfowId. * @param workflowId WorkflowId of the workflow. */ @Service public void pauseWorkflow(String workflowId) { workflowExecutor.pauseWorkflow(workflowId); }
/** * Pause the list of workflows. * @param workflowIds - list of workflow Ids to perform pause operation on * @return bulk response object containing a list of succeeded workflows and a list of failed ones with errors */ @Service public BulkResponse pauseWorkflow(List<String> workflowIds){ for (String workflowId : workflowIds) { workflowExecutor.pauseWorkflow(workflowId); } BulkResponse bulkResponse = new BulkResponse(); for (String workflowId : workflowIds) { try { workflowExecutor.pauseWorkflow(workflowId); bulkResponse.appendSuccessResponse(workflowId); } catch (Exception e) { LOGGER.error("bulk pauseWorkflow exception, workflowId {}, message: {} ",workflowId, e.getMessage(), e); bulkResponse.appendFailedResponse(workflowId, e.getMessage()); } } return bulkResponse; }