Class TaskResult
java.lang.Object
com.netflix.conductor.common.metadata.tasks.TaskResult
Result of the task execution.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOutputData(String key, Object value) Adds outputstatic TaskResultcomplete()static TaskResultfailed()static TaskResultlonggetLogs()static TaskResultbooleanstatic TaskResultnewTaskResult(TaskResult.Status status) voidsetCallbackAfterSeconds(long callbackAfterSeconds) When set to non-zero values, the task remains in the queue for the specified seconds before sent back to the worker when polled.voidsetExtendLease(boolean extendLease) voidsetExternalOutputPayloadStoragePath(String externalOutputPayloadStoragePath) voidsetLogs(List<TaskExecLog> logs) voidsetOutputData(Map<String, Object> outputData) voidsetReasonForIncompletion(String reasonForIncompletion) voidsetStatus(TaskResult.Status status) voidsetSubWorkflowId(String subWorkflowId) voidvoidsetWorkerId(String workerId) voidsetWorkflowInstanceId(String workflowInstanceId) toString()
-
Constructor Details
-
TaskResult
-
TaskResult
public TaskResult()
-
-
Method Details
-
getWorkflowInstanceId
- Returns:
- Workflow instance id for which the task result is produced
-
setWorkflowInstanceId
-
getTaskId
-
setTaskId
-
getReasonForIncompletion
-
setReasonForIncompletion
-
getCallbackAfterSeconds
public long getCallbackAfterSeconds() -
setCallbackAfterSeconds
public void setCallbackAfterSeconds(long callbackAfterSeconds) When set to non-zero values, the task remains in the queue for the specified seconds before sent back to the worker when polled. Useful for the long running task, where the task is updated as IN_PROGRESS and should not be polled out of the queue for a specified amount of time. (delayed queue implementation)- Parameters:
callbackAfterSeconds- Amount of time in seconds the task should be held in the queue before giving it to a polling worker.
-
getWorkerId
-
setWorkerId
- Parameters:
workerId- a free form string identifying the worker host. Could be hostname, IP Address or any other meaningful identifier that can help identify the host/process which executed the task, in case of troubleshooting.
-
getStatus
- Returns:
- the status
-
setStatus
- Parameters:
status- Status of the taskIN_PROGRESS: Use this for long running tasks, indicating the task is still in progress and should be checked again at a later time. e.g. the worker checks the status of the job in the DB, while the job is being executed by another process.
FAILED, FAILED_WITH_TERMINAL_ERROR, COMPLETED: Terminal statuses for the task. Use FAILED_WITH_TERMINAL_ERROR when you do not want the task to be retried.
- See Also:
-
getOutputData
-
setOutputData
- Parameters:
outputData- output data to be set for the task execution result
-
addOutputData
Adds output- Parameters:
key- output fieldvalue- value- Returns:
- current instance
-
getLogs
- Returns:
- Task execution logs
-
setLogs
- Parameters:
logs- Task execution logs
-
log
- Parameters:
log- Log line to be added- Returns:
- Instance of TaskResult
-
getExternalOutputPayloadStoragePath
- Returns:
- the path where the task output is stored in external storage
-
setExternalOutputPayloadStoragePath
- Parameters:
externalOutputPayloadStoragePath- path in the external storage where the task output is stored
-
getSubWorkflowId
-
setSubWorkflowId
-
isExtendLease
public boolean isExtendLease() -
setExtendLease
public void setExtendLease(boolean extendLease) -
toString
-
complete
-
failed
-
failed
-
inProgress
-
newTaskResult
-