Interface ITaskResultBuilder
interface ITaskResultBuilder
Extends com.amazon.apmf.IStandard
The ITaskResultBuilder is used to create an object that conforms to ITaskResult. The
ITaskResult can then be submitted to post updates about Task execution and to indicate success
or failure to the TaskManager.
Methods
data()
Set a strongly typed result payload to communicate the results of the task execution. The payload may be any valid Omnikit Data Object. Submitting results with user defined data is a convenience for directly alerting Task Observers active at that point in time. They are not a substitute for persisting results so that they can be retrieved when the caller runs in the future. Task Manager does not offer any result storage capability.ITaskResultBuilder*data(com.amazon.apmf.IStandard*data)
Parameters
data
com.amazon.apmf.IStandard* — Required
Payload to be sent.
Returns
ITaskResultBuilder*
An ITaskResultBuilder instance that can be used for further calls.
build()
Builds aITaskResult*build(TaskCompletionStatuscompletionStatus)
ITaskResult with the set parameters. If a terminal status from
TaskCompletionStatus is posted in ITaskResult, the task handler should return. The system
will stop the app process soon after. Post TaskCompletionStatus::IN_PROGRESS when posting
intermediate results.
Note that calling this method is the last step after calling other methods in the builder.
Parameters
completionStatus
TaskCompletionStatus — Required
Completion status to indicate progress or final outcome.
Returns
ITaskResult*
A ITaskResult instance to be given to TaskManager for submitResult().
Throws
com.amazon.apmf.InvalidArgumentError— If any set member variable is invalid.

