Package com.veeva.vault.sdk.api.job
Interface TaskOutput
public interface TaskOutput
Methods to get and set output parameters for a job task.
-
Method Summary
Modifier and TypeMethodDescriptiongetState()
Retrieves the task state for a specific state.<T> T
getValue
(String name, JobValueType<T> valueType) Retrieves the value identified by the givenname
from the task output.<T extends JobValue>
TRetrieves the value identified by the givenname
from the task output.void
setRetry()
Flags this task for retry.void
Sets task state for a specific task.void
Sets the value of a task parameter.
-
Method Details
-
setValue
Sets the value of a task parameter. This can be used byJob.process(JobProcessContext)
to set the output parameters of a task when the task is completed.- Parameters:
name
- name of the parametervalue
- new value to set on the parameter. Must be one of the data types specified inJobValueType
or implementsJobValue
.
-
getValue
Retrieves the value identified by the givenname
from the task output.- Type Parameters:
T
- type of object requested. Cannot be null.- Parameters:
name
- name of the object to get from the task output. Cannot be null.valueType
- type of object requested. Cannot be null.- Returns:
- the object identified by the given name, or null if there was no value for the given name
-
getValue
Retrieves the value identified by the givenname
from the task output.- Type Parameters:
T
- type of object requested. Cannot be null.- Parameters:
name
- name of the object to get from the task output. Cannot be null.returnType
- type of object requested. Cannot be null.- Returns:
- the object identified by the given name, or null if there was no value for the given name
-
getState
TaskState getState()Retrieves the task state for a specific state.- Returns:
- task state
-
setState
Sets task state for a specific task. For example, when a task completes successfully, mark the task asSUCCESS
.- Parameters:
taskState
- task state to set, must be valid value fromTaskState
-
setRetry
void setRetry()Flags this task for retry.JobInfo.idempotent()
must be set to true. The maximum number of retries per task is 10.
-