Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface ITaskManager2

interface ITaskManager2
Extends ITaskManager Extension of ITaskManager with operations scoped to a running Task instance. Provides methods to retrieve the IMessage that triggered a Task and to submit execution results.

Methods

tryGetMessageTrigger()

com.amazon.kepler.messaging.IMessage? tryGetMessageTrigger(TaskExecutionInfo* taskExecutionInfo)
Get the IMessage that triggered this Task. The Task must have been scheduled with a Message trigger constraint. Any payload supplied by the sender can be retrieved from the message’s attachment. Note that payloads are not persisted across restarts or reboots. Note that once a terminal TaskCompletionStatus has been submitted via submitResult, the triggering IMessage is not guaranteed to remain available; callers should retrieve any needed payload before submitting a terminal result.

Parameters

taskExecutionInfo
TaskExecutionInfo* — Required The TaskExecutionInfo identifying the running Task.

Returns

com.amazon.kepler.messaging.IMessage? The return value is optional and might be absent. The optional IMessage that triggered this Task, null if it was not triggered by a Message.

Throws


submitResult()

void submitResult(TaskExecutionInfo* taskExecutionInfo, ITaskResult* taskResult)
Submit the result of Task execution to the Task Manager. It is required to post a terminal TaskCompletionStatus to indicate that the Task is done. Note that this call is idempotent with respect to terminal results: once a terminal TaskCompletionStatus has been submitted for a Task, submitting a further result for the same TaskExecutionInfo is a silent no-op and does not throw.

Parameters

taskExecutionInfo
TaskExecutionInfo* — Required The TaskExecutionInfo identifying the running Task.
taskResult
ITaskResult* — Required The intermediate or final Task Result.

Throws


Last modified on October 29, 2026