接口 ITaskService


  • public interface ITaskService
    Client for taskflow task management including polling for task, updating task status etc.
    • 方法详细资料

      • pollTask

        ExecutingTask pollTask​(String taskType,
                               String workerId,
                               String domain)
        Perform a poll for a task of a specific task type.
        参数:
        taskType - The taskType to poll for
        domain - The domain of the task type
        workerId - Name of the client worker. Used for logging.
        返回:
        Task waiting to be executed.
      • batchPollTasksByTaskType

        List<ExecutingTask> batchPollTasksByTaskType​(String taskType,
                                                     String workerId,
                                                     int count,
                                                     int timeoutInMillisecond)
        Perform a batch poll for tasks by task type. Batch size is configurable by count.
        参数:
        taskType - Type of task to poll for
        workerId - Name of the client worker. Used for logging.
        count - Maximum number of tasks to be returned. Actual number of tasks returned can be less than this number.
        timeoutInMillisecond - Long poll wait timeout.
        返回:
        List of tasks awaiting to be executed.
      • batchPollTasksInDomain

        List<ExecutingTask> batchPollTasksInDomain​(String taskType,
                                                   String domain,
                                                   String workerId,
                                                   int count,
                                                   int timeoutInMillisecond)
        Batch poll for tasks in a domain. Batch size is configurable by count.
        参数:
        taskType - Type of task to poll for
        domain - The domain of the task type
        workerId - Name of the client worker. Used for logging.
        count - Maximum number of tasks to be returned. Actual number of tasks returned can be less than this number.
        timeoutInMillisecond - Long poll wait timeout.
        返回:
        List of tasks awaiting to be executed.
      • updateTask

        void updateTask​(TaskExecResult taskResult)
        Updates the result of a task execution. If the size of the task output payload is bigger than ExternalPayloadStorage, if enabled, else the task is marked as FAILED_WITH_TERMINAL_ERROR.
        参数:
        taskResult - the TaskExecResult of the executed task to be updated.
      • logMessageForTask

        void logMessageForTask​(String taskId,
                               String logMessage)
        Log execution messages for a task.
        参数:
        taskId - id of the task
        logMessage - the message to be logged
      • getTaskLogs

        List<TaskLog> getTaskLogs​(String taskId)
        Fetch execution logs for a task.
        参数:
        taskId - id of the task.
      • getTaskDetails

        ExecutingTask getTaskDetails​(String taskId)
        Retrieve information about the task
        参数:
        taskId - ID of the task
        返回:
        Task details
      • requeuePendingTasksByTaskType

        String requeuePendingTasksByTaskType​(String taskType)
        Requeue pending tasks of a specific task type
        返回:
        returns the number of tasks that have been requeued
      • updateTask

        void updateTask​(String workflowId,
                        String taskReferenceName,
                        TaskExecResult.Status status,
                        Map<String,​Object> output)
        Update the task status and output based given workflow id and task reference name
        参数:
        workflowId - Workflow Id
        taskReferenceName - Reference name of the task to be updated
        status - Status of the task
        output - Output for the task