接口 ITaskService
-
public interface ITaskService
Client for taskflow task management including polling for task, updating task status etc.
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 List<ExecutingTask>
batchPollTasksByTaskType(String taskType, String workerId, int count, int timeoutInMillisecond)
Perform a batch poll for tasks by task type.List<ExecutingTask>
batchPollTasksInDomain(String taskType, String domain, String workerId, int count, int timeoutInMillisecond)
Batch poll for tasks in a domain.ExecutingTask
getTaskDetails(String taskId)
Retrieve information about the taskList<TaskLog>
getTaskLogs(String taskId)
Fetch execution logs for a task.void
logMessageForTask(String taskId, String logMessage)
Log execution messages for a task.ExecutingTask
pollTask(String taskType, String workerId, String domain)
Perform a poll for a task of a specific task type.String
requeuePendingTasksByTaskType(String taskType)
Requeue pending tasks of a specific task typevoid
updateTask(TaskExecResult taskResult)
Updates the result of a task execution.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
-
-
-
方法详细资料
-
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 fordomain
- The domain of the task typeworkerId
- 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 forworkerId
- 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 fordomain
- The domain of the task typeworkerId
- 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 thanExternalPayloadStorage
, if enabled, else the task is marked as FAILED_WITH_TERMINAL_ERROR.- 参数:
taskResult
- theTaskExecResult
of the executed task to be updated.
-
logMessageForTask
void logMessageForTask(String taskId, String logMessage)
Log execution messages for a task.- 参数:
taskId
- id of the tasklogMessage
- 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 IdtaskReferenceName
- Reference name of the task to be updatedstatus
- Status of the taskoutput
- Output for the task
-
-