Skips a given task from a current running workflow.

@param workflowId        WorkflowId of the workflow.
@param taskReferenceName The task reference name.
@param skipTaskRequest   {@link SkipTaskRequest} for task you want to skip.
179016
@Service
    public void skipTaskFromWorkflow(String workflowId, String taskReferenceName,
                                     SkipTaskRequest skipTaskRequest) {
        workflowExecutor.skipTaskFromWorkflow(workflowId, taskReferenceName, skipTaskRequest);
    }
274371
@Override
  public void workerPreempted(final String id) {
    final Optional<Collection<Tasklet>> preemptedTasklets = runningWorkers.removeWorker(id);
    if (preemptedTasklets.isPresent()) {
      for (final Tasklet tasklet : preemptedTasklets.get()) {
        pendingTasklets.addFirst(tasklet);
      }
    }
  }
89476
public void setWorkflowInstanceLinkLocalService(
		com.liferay.portal.kernel.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService) {
		this.workflowInstanceLinkLocalService = workflowInstanceLinkLocalService;
	}
1019422
public static void processTask(Task task) {
    logger.finest("Processing task " + task);
    try {
      switch (task.getType()) {
        case RUN_JOB:
          runJob((RunJobTask) task);
          break;
        case HANDLE_SLOT_FILLED:
          handleSlotFilled((HandleSlotFilledTask) task);
          break;
        case FINALIZE_JOB:
          finalizeJob((FinalizeJobTask) task);
          break;
        case FAN_OUT:
          handleFanoutTaskOrAbandonTask((FanoutTask) task);
          break;
        case CANCEL_JOB:
          cancelJob((CancelJobTask) task);
          break;
        case DELETE_PIPELINE:
          DeletePipelineTask deletePipelineTask = (DeletePipelineTask) task;
          try {
            backEnd.deletePipeline(
                deletePipelineTask.getRootJobKey(), deletePipelineTask.shouldForce(), false);
          } catch (Exception e) {
            logger.log(Level.WARNING, "DeletePipeline operation failed.", e);
          }
          break;
        case HANDLE_CHILD_EXCEPTION:
          handleChildException((HandleChildExceptionTask) task);
          break;
        case DELAYED_SLOT_FILL:
          handleDelayedSlotFill((DelayedSlotFillTask) task);
          break;
        default:
          throw new IllegalArgumentException("Unrecognized task type: " + task.getType());
      }
    } catch (AbandonTaskException ate) {
      // return 200;
    }
  }
1247992
@Service
    public void updateTaskDef(TaskDef taskDefinition) {
        TaskDef existing = metadataDAO.getTaskDef(taskDefinition.getName());
        if (existing == null) {
            throw new ApplicationException(Code.NOT_FOUND, "No such task by name " + taskDefinition.getName());
        }
        taskDefinition.setUpdatedBy(WorkflowContext.get().getClientApp());
        taskDefinition.setUpdateTime(System.currentTimeMillis());
        metadataDAO.updateTaskDef(taskDefinition);
    }
1129216
public void resetCallbacksForInProgressTasks(String workflowId) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
        stub.resetWorkflowCallbacks(WorkflowServicePb.ResetWorkflowCallbacksRequest.newBuilder()
                .setWorkflowId(workflowId)
                .build()
        );
    }
415919
@Service
    public BulkResponse pauseWorkflow(List<String> workflowIds){

        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;
    }
706512
public String rerunWorkflow(String workflowId, RerunWorkflowRequest rerunWorkflowRequest) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
        Preconditions.checkNotNull(rerunWorkflowRequest, "RerunWorkflowRequest cannot be null");

        return postForEntity("workflow/{workflowId}/rerun", rerunWorkflowRequest, null, String.class, workflowId);
    }
1275565
@Override
	public TaskBase getTask(String processDefinitionName, Long taskid) {
		ProcessDefinition pd = getProcessDefinition(processDefinitionName);
		if (pd == null) {
			throw new WorkflowException("Could not find active process for "+processDefinitionName);
		}
		TaskBase task = getTask(pd,taskid);
		if (task == null) {
			throw new WorkflowException("Could not find task for "+processDefinitionName+":"+taskid);
		}
		return task;
	}
652483
public void resumeWorkflow(String workflowId) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
        stub.resumeWorkflow(WorkflowServicePb.ResumeWorkflowRequest.newBuilder()
                .setWorkflowId(workflowId)
                .build()
        );
    }
203813
public void deleteWorkflow(String workflowId, boolean archiveWorkflow) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "Workflow id cannot be blank");
        stub.removeWorkflow(
                WorkflowServicePb.RemoveWorkflowRequest.newBuilder()
                        .setWorkflodId(workflowId)
                        .setArchiveWorkflow(archiveWorkflow)
                        .build()
        );
    }
14564
public void deleteWorkflow(String workflowId, boolean archiveWorkflow) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "Workflow id cannot be blank");

        Object[] params = new Object[]{"archiveWorkflow", archiveWorkflow};
        delete(params, "workflow/{workflowId}/remove", workflowId);
    }
1099816
public void filterSkippedTaskStates() {
    List<TaskState> skippedTaskStates = new ArrayList<>();
    for (TaskState taskState : this.taskStates.values()) {
      if (taskState.getWorkingState() == WorkUnitState.WorkingState.SKIPPED) {
        skippedTaskStates.add(taskState);
      }
    }
    for (TaskState taskState : skippedTaskStates) {
      removeTaskState(taskState);
      addSkippedTaskState(taskState);
    }
  }
1122699
public Task getPendingTaskForWorkflow(String workflowId, String taskReferenceName) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "Workflow id cannot be blank");
        Preconditions.checkArgument(StringUtils.isNotBlank(taskReferenceName), "Task reference name cannot be blank");

        TaskServicePb.PendingTaskResponse response = stub.getPendingTaskForWorkflow(
                TaskServicePb.PendingTaskRequest.newBuilder()
                        .setWorkflowId(workflowId)
                        .setTaskRefName(taskReferenceName)
                        .build()
        );
        return protoMapper.fromProto(response.getTask());
    }
1005708
public void startTask(int id, String taskName) {
        if (isActivated) {
            durations.add(new Duration(id, taskName, BenchmarkUtil.elapsedRealTimeNanos()));
        }
    }
1174274
@Override
  public void cancelFlow(final ExecutableFlow exFlow, final String userId)
      throws ExecutorManagerException {
    synchronized (exFlow) {
      final Map<Integer, Pair<ExecutionReference, ExecutableFlow>> unfinishedFlows = this.executorLoader
          .fetchUnfinishedFlows();
      if (unfinishedFlows.containsKey(exFlow.getExecutionId())) {
        final Pair<ExecutionReference, ExecutableFlow> pair = unfinishedFlows
            .get(exFlow.getExecutionId());
        if (pair.getFirst().getExecutor().isPresent()) {
          // Flow is already dispatched to an executor, so call that executor to cancel the flow.
          this.apiGateway
              .callWithReferenceByUser(pair.getFirst(), ConnectorParams.CANCEL_ACTION, userId);
        } else {
          // Flow is still queued, need to finalize it and update the status in DB.
          ExecutionControllerUtils.finalizeFlow(this.executorLoader, this.alerterHolder, exFlow,
              "Cancelled before dispatching to executor", null);
        }
      } else {
        throw new ExecutorManagerException("Execution "
            + exFlow.getExecutionId() + " of flow " + exFlow.getFlowId()
            + " isn't running.");
      }
    }
  }
274628
private void setLastWorkflowForUser(String workflowId) throws CmsException {

        CmsUser user = getCmsObject().getRequestContext().getCurrentUser();
        user.setAdditionalInfo(PARAM_WORKFLOW_ID, workflowId);
        getCmsObject().writeUser(user);
    }