Interface TaskOrchestrationContext
-
public interface TaskOrchestrationContextUsed by orchestrators to perform actions such as scheduling tasks, durable timers, waiting for external events, and for getting basic information about the current orchestration.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <V> Task<java.util.List<V>>allOf(Task<V>... tasks)Returns a newTaskthat is completed when all the givenTasks complete.<V> Task<java.util.List<V>>allOf(java.util.List<Task<V>> tasks)Returns a newTaskthat is completed when all tasks intaskscompletes.default Task<Task<?>>anyOf(Task<?>... tasks)Returns a newTaskthat is completed when any of the givenTasks complete.Task<Task<?>>anyOf(java.util.List<Task<?>> tasks)Returns a newTaskthat is completed when any of the tasks intaskscompletes.default Task<java.lang.Void>callActivity(java.lang.String name)Asynchronously invokes an activity by name and returns a newTaskthat completes when the activity completes.default <V> Task<V>callActivity(java.lang.String name, java.lang.Class<V> returnType)Asynchronously invokes an activity by name and returns a newTaskthat completes when the activity completes.default Task<java.lang.Void>callActivity(java.lang.String name, java.lang.Object input)Asynchronously invokes an activity by name and with the specified input value and returns a newTaskthat completes when the activity completes.default Task<java.lang.Void>callActivity(java.lang.String name, java.lang.Object input, TaskOptions options)Asynchronously invokes an activity by name and with the specified input value and returns a newTaskthat completes when the activity completes.<V> Task<V>callActivity(java.lang.String name, java.lang.Object input, TaskOptions options, java.lang.Class<V> returnType)Asynchronously invokes an activity by name and with the specified input value and returns a newTaskthat completes when the activity completes.default <V> Task<V>callActivity(java.lang.String name, java.lang.Object input, java.lang.Class<V> returnType)Asynchronously invokes an activity by name and with the specified input value and returns a newTaskthat completes when the activity completes.If the activity completes successfully, the returnedTask's value will be the activity's output.default Task<java.lang.Void>callSubOrchestrator(java.lang.String name)Asynchronously invokes another orchestrator as a sub-orchestration and returns aTaskthat completes when the sub-orchestration completes.default Task<java.lang.Void>callSubOrchestrator(java.lang.String name, java.lang.Object input)Asynchronously invokes another orchestrator as a sub-orchestration and returns aTaskthat completes when the sub-orchestration completes.default <V> Task<V>callSubOrchestrator(java.lang.String name, java.lang.Object input, java.lang.Class<V> returnType)Asynchronously invokes another orchestrator as a sub-orchestration and returns aTaskthat completes when the sub-orchestration completes.default Task<java.lang.Void>callSubOrchestrator(java.lang.String name, java.lang.Object input, java.lang.String instanceID, TaskOptions options)Asynchronously invokes another orchestrator as a sub-orchestration and returns aTaskthat completes when the sub-orchestration completes.<V> Task<V>callSubOrchestrator(java.lang.String name, java.lang.Object input, java.lang.String instanceID, TaskOptions options, java.lang.Class<V> returnType)Asynchronously invokes another orchestrator as a sub-orchestration and returns aTaskthat completes when the sub-orchestration completes.default <V> Task<V>callSubOrchestrator(java.lang.String name, java.lang.Object input, java.lang.String instanceID, java.lang.Class<V> returnType)Asynchronously invokes another orchestrator as a sub-orchestration and returns aTaskthat completes when the sub-orchestration completes.voidclearCustomStatus()Clears the orchestration's custom status.voidcomplete(java.lang.Object output)Transitions the orchestration into theOrchestrationRuntimeStatus.COMPLETEDstate with the given output.default voidcontinueAsNew(java.lang.Object input)Restarts the orchestration with a new input and clears its history.voidcontinueAsNew(java.lang.Object input, boolean preserveUnprocessedEvents)Restarts the orchestration with a new input and clears its history.Task<java.lang.Void>createTimer(java.time.Duration delay)Creates a durable timer that expires after the specified delay.default Task<java.lang.Void>createTimer(java.time.ZonedDateTime zonedDateTime)Creates a durable timer that expires after the specified timestamp with specific zone.java.time.InstantgetCurrentInstant()Gets the current orchestration time in UTC.<V> VgetInput(java.lang.Class<V> targetType)Gets the deserialized input of the current task orchestration.java.lang.StringgetInstanceId()Gets the unique ID of the current orchestration instance.booleangetIsReplaying()Gets a value indicating whether the orchestrator is currently replaying a previous execution.java.lang.StringgetName()Gets the name of the current task orchestration.default java.util.UUIDnewUUID()Create a new UUID that is safe for replay within an orchestration or operation.default voidsendEvent(java.lang.String instanceID, java.lang.String eventName)Sends an external event to another orchestration instance.voidsendEvent(java.lang.String instanceId, java.lang.String eventName, java.lang.Object eventData)Sends an external event to another orchestration instance.voidsetCustomStatus(java.lang.Object customStatus)Assigns a custom status value to the current orchestration.default Task<java.lang.Void>waitForExternalEvent(java.lang.String name)Waits for an event to be raised namednameand returns aTaskthat completes when the event is received.default <V> Task<V>waitForExternalEvent(java.lang.String name, java.lang.Class<V> dataType)Waits for an event to be raised namednameand returns aTaskthat completes when the event is received.default Task<java.lang.Void>waitForExternalEvent(java.lang.String name, java.time.Duration timeout)Waits for an event to be raised namednameand returns aTaskthat completes when the event is received or is canceled whentimeoutexpires.<V> Task<V>waitForExternalEvent(java.lang.String name, java.time.Duration timeout, java.lang.Class<V> dataType)Waits for an event to be raised namednameand returns aTaskthat completes when the event is received or is canceled whentimeoutexpires.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of the current task orchestration.- Returns:
- the name of the current task orchestration
-
getInput
<V> V getInput(java.lang.Class<V> targetType)
Gets the deserialized input of the current task orchestration.- Type Parameters:
V- the expected type of the orchestrator input- Parameters:
targetType- theClassobject associated withV- Returns:
- the deserialized input as an object of type
Vornullif no input was provided.
-
getInstanceId
java.lang.String getInstanceId()
Gets the unique ID of the current orchestration instance.- Returns:
- the unique ID of the current orchestration instance
-
getCurrentInstant
java.time.Instant getCurrentInstant()
Gets the current orchestration time in UTC.- Returns:
- the current orchestration time in UTC
-
getIsReplaying
boolean getIsReplaying()
Gets a value indicating whether the orchestrator is currently replaying a previous execution.Orchestrator functions are "replayed" after being unloaded from memory to reconstruct local variable state. During a replay, previously executed tasks will be completed automatically with previously seen values that are stored in the orchestration history. One the orchestrator reaches the point in the orchestrator where it's no longer replaying existing history, this method will return
false.You can use this method if you have logic that needs to run only when not replaying. For example, certain types of application logging may become too noisy when duplicated as part of replay. The application code could check to see whether the function is being replayed and then issue the log statements when this value is
false.- Returns:
trueif the orchestrator is replaying, otherwisefalse
-
allOf
<V> Task<java.util.List<V>> allOf(java.util.List<Task<V>> tasks)
Returns a newTaskthat is completed when all tasks intaskscompletes. SeeallOf(Task[])for more detailed information.- Type Parameters:
V- the return type of theTaskobjects- Parameters:
tasks- the list ofTaskobjects- Returns:
- a new
Taskthat is completed when any of the givenTasks complete - See Also:
allOf(Task[])
-
allOf
default <V> Task<java.util.List<V>> allOf(Task<V>... tasks)
Returns a newTaskthat is completed when all the givenTasks complete. If any of the givenTasks complete with an exception, the returnedTaskwill also complete with anCompositeTaskFailedExceptioncontaining details of the first encountered failure. The value of the returnedTaskis an ordered list of the return values of the given tasks. If no tasks are provided, returns aTaskcompleted with valuenull.This method is useful for awaiting the completion of a set of independent tasks before continuing to the next step in the orchestration, as in the following example:
Exceptions in any of the given tasks results in an uncheckedTask<String> t1 = ctx.callActivity("MyActivity", String.class); Task<String> t2 = ctx.callActivity("MyActivity", String.class); Task<String> t3 = ctx.callActivity("MyActivity", String.class); List<String> orderedResults = ctx.allOf(t1, t2, t3).await();CompositeTaskFailedException. This exception can be inspected to obtain failure details of individualTasks.try { List<String> orderedResults = ctx.allOf(t1, t2, t3).await(); } catch (CompositeTaskFailedException e) { List<Exception> exceptions = e.getExceptions() }- Type Parameters:
V- the return type of theTaskobjects- Parameters:
tasks- theTasks- Returns:
- the values of the completed
Taskobjects in the same order as the source list
-
anyOf
Task<Task<?>> anyOf(java.util.List<Task<?>> tasks)
Returns a newTaskthat is completed when any of the tasks intaskscompletes. SeeanyOf(Task[])for more detailed information.- Parameters:
tasks- the list ofTaskobjects- Returns:
- a new
Taskthat is completed when any of the givenTasks complete - See Also:
anyOf(Task[])
-
anyOf
default Task<Task<?>> anyOf(Task<?>... tasks)
Returns a newTaskthat is completed when any of the givenTasks complete. The value of the newTaskis a reference to the completedTaskobject. If no tasks are provided, returns aTaskthat never completes.This method is useful for waiting on multiple concurrent tasks and performing a task-specific operation when the first task completes, as in the following example:
TheTask<Void> event1 = ctx.waitForExternalEvent("Event1"); Task<Void> event2 = ctx.waitForExternalEvent("Event2"); Task<Void> event3 = ctx.waitForExternalEvent("Event3"); Task<?> winner = ctx.anyOf(event1, event2, event3).await(); if (winner == event1) { // ... } else if (winner == event2) { // ... } else if (winner == event3) { // ... }anyOfmethod can also be used for implementing long-running timeouts, as in the following example:Task<Void> activityTask = ctx.callActivity("SlowActivity"); Task<Void> timeoutTask = ctx.createTimer(Duration.ofMinutes(30)); Task<?> winner = ctx.anyOf(activityTask, timeoutTask).await(); if (winner == activityTask) { // completion case } else { // timeout case }- Parameters:
tasks- the list ofTaskobjects- Returns:
- a new
Taskthat is completed when any of the givenTasks complete
-
createTimer
Task<java.lang.Void> createTimer(java.time.Duration delay)
Creates a durable timer that expires after the specified delay.Specifying a long delay (for example, a delay of a few days or more) may result in the creation of multiple, internally-managed durable timers. The orchestration code doesn't need to be aware of this behavior. However, it may be visible in framework logs and the stored history state.
- Parameters:
delay- the amount of time before the timer should expire- Returns:
- a new
Taskthat completes after the specified delay
-
createTimer
default Task<java.lang.Void> createTimer(java.time.ZonedDateTime zonedDateTime)
Creates a durable timer that expires after the specified timestamp with specific zone.Specifying a long delay (for example, a delay of a few days or more) may result in the creation of multiple, internally-managed durable timers. The orchestration code doesn't need to be aware of this behavior. However, it may be visible in framework logs and the stored history state.
- Parameters:
zonedDateTime- timestamp with specific zone when the timer should expire- Returns:
- a new
Taskthat completes after the specified delay
-
complete
void complete(java.lang.Object output)
Transitions the orchestration into theOrchestrationRuntimeStatus.COMPLETEDstate with the given output.- Parameters:
output- the serializable output of the completed orchestration
-
callActivity
<V> Task<V> callActivity(java.lang.String name, java.lang.Object input, TaskOptions options, java.lang.Class<V> returnType)
Asynchronously invokes an activity by name and with the specified input value and returns a newTaskthat completes when the activity completes. If the activity completes successfully, the returnedTask's value will be the activity's output. If the activity fails, the returnedTaskwill complete exceptionally with aTaskFailedException.Activities are the basic unit of work in a durable task orchestration. Unlike orchestrators, which are not allowed to do any I/O or call non-deterministic APIs, activities have no implementation restrictions.
An activity may execute in the local machine or a remote machine. The exact behavior depends on the underlying storage provider, which is responsible for distributing tasks across machines. In general, you should never make any assumptions about where an activity will run. You should also assume at-least-once execution guarantees for activities, meaning that an activity may be executed twice if, for example, there is a process failure before the activities result is saved into storage.
Both the inputs and outputs of activities are serialized and stored in durable storage. It's highly recommended to not include any sensitive data in activity inputs or outputs. It's also recommended to not use large payloads for activity inputs and outputs, which can result in expensive serialization and network utilization. For data that cannot be cheaply or safely persisted to storage, it's recommended to instead pass references (for example, a URL to a storage blog) to the data and have activities fetch the data directly as part of their implementation.
- Type Parameters:
V- the expected type of the activity output- Parameters:
name- the name of the activity to callinput- the serializable input to pass to the activityoptions- additional options that control the execution and processing of the activityreturnType- the expected class type of the activity output- Returns:
- a new
Taskthat completes when the activity completes or fails
-
callActivity
default Task<java.lang.Void> callActivity(java.lang.String name)
Asynchronously invokes an activity by name and returns a newTaskthat completes when the activity completes. SeecallActivity(String, Object, TaskOptions, Class)for a complete description.- Parameters:
name- the name of the activity to call- Returns:
- a new
Taskthat completes when the activity completes or fails - See Also:
callActivity(String, Object, TaskOptions, Class)
-
callActivity
default Task<java.lang.Void> callActivity(java.lang.String name, java.lang.Object input)
Asynchronously invokes an activity by name and with the specified input value and returns a newTaskthat completes when the activity completes. SeecallActivity(String, Object, TaskOptions, Class)for a complete description.- Parameters:
name- the name of the activity to callinput- the serializable input to pass to the activity- Returns:
- a new
Taskthat completes when the activity completes or fails
-
callActivity
default <V> Task<V> callActivity(java.lang.String name, java.lang.Class<V> returnType)
Asynchronously invokes an activity by name and returns a newTaskthat completes when the activity completes. If the activity completes successfully, the returnedTask's value will be the activity's output. SeecallActivity(String, Object, TaskOptions, Class)for a complete description.- Type Parameters:
V- the expected type of the activity output- Parameters:
name- the name of the activity to callreturnType- the expected class type of the activity output- Returns:
- a new
Taskthat completes when the activity completes or fails
-
callActivity
default <V> Task<V> callActivity(java.lang.String name, java.lang.Object input, java.lang.Class<V> returnType)
Asynchronously invokes an activity by name and with the specified input value and returns a newTaskthat completes when the activity completes.If the activity completes successfully, the returnedTask's value will be the activity's output. SeecallActivity(String, Object, TaskOptions, Class)for a complete description.- Type Parameters:
V- the expected type of the activity output- Parameters:
name- the name of the activity to callinput- the serializable input to pass to the activityreturnType- the expected class type of the activity output- Returns:
- a new
Taskthat completes when the activity completes or fails
-
callActivity
default Task<java.lang.Void> callActivity(java.lang.String name, java.lang.Object input, TaskOptions options)
Asynchronously invokes an activity by name and with the specified input value and returns a newTaskthat completes when the activity completes. SeecallActivity(String, Object, TaskOptions, Class)for a complete description.- Parameters:
name- the name of the activity to callinput- the serializable input to pass to the activityoptions- additional options that control the execution and processing of the activity- Returns:
- a new
Taskthat completes when the activity completes or fails
-
continueAsNew
default void continueAsNew(java.lang.Object input)
Restarts the orchestration with a new input and clears its history. SeecontinueAsNew(Object, boolean)for a full description.- Parameters:
input- the serializable input data to re-initialize the instance with
-
newUUID
default java.util.UUID newUUID()
Create a new UUID that is safe for replay within an orchestration or operation.The default implementation of this method creates a name-based UUID using the algorithm from RFC 4122 ยง4.3. The name input used to generate this value is a combination of the orchestration instance ID and an internally managed sequence number.
- Returns:
- a deterministic UUID
-
continueAsNew
void continueAsNew(java.lang.Object input, boolean preserveUnprocessedEvents)Restarts the orchestration with a new input and clears its history.This method is primarily designed for eternal orchestrations, which are orchestrations that may not ever complete. It works by restarting the orchestration, providing it with a new input, and truncating the existing orchestration history. It allows an orchestration to continue running indefinitely without having its history grow unbounded. The benefits of periodically truncating history include decreased memory usage, decreased storage volumes, and shorter orchestrator replays when rebuilding state.
The results of any incomplete tasks will be discarded when an orchestrator calls
continueAsNew. For example, if a timer is scheduled and thencontinueAsNewis called before the timer fires, the timer event will be discarded. The only exception to this is external events. By default, if an external event is received by an orchestration but not yet processed, the event is saved in the orchestration state unit it is received by a call towaitForExternalEvent(java.lang.String, java.time.Duration, java.lang.Class<V>). These events will remain in memory even after an orchestrator restarts usingcontinueAsNew. This behavior can be disabled by specifyingfalsefor thepreserveUnprocessedEventsparameter value.Orchestrator implementations should complete immediately after calling the
continueAsNewmethod.- Parameters:
input- the serializable input data to re-initialize the instance withpreserveUnprocessedEvents-trueto push unprocessed external events into the new orchestration history, otherwisefalse
-
sendEvent
default void sendEvent(java.lang.String instanceID, java.lang.String eventName)Sends an external event to another orchestration instance.- Parameters:
instanceID- the unique ID of the receiving orchestration instance.eventName- the name of the event to send
-
sendEvent
void sendEvent(java.lang.String instanceId, java.lang.String eventName, java.lang.Object eventData)Sends an external event to another orchestration instance.- Parameters:
instanceId- the unique ID of the receiving orchestration instance.eventName- the name of the event to sendeventData- the payload of the event to send
-
callSubOrchestrator
default Task<java.lang.Void> callSubOrchestrator(java.lang.String name)
Asynchronously invokes another orchestrator as a sub-orchestration and returns aTaskthat completes when the sub-orchestration completes.See
callSubOrchestrator(String, Object, String, TaskOptions, Class)for a full description.- Parameters:
name- the name of the orchestrator to invoke- Returns:
- a new
Taskthat completes when the sub-orchestration completes or fails - See Also:
callSubOrchestrator(String, Object, String, TaskOptions, Class)
-
callSubOrchestrator
default Task<java.lang.Void> callSubOrchestrator(java.lang.String name, java.lang.Object input)
Asynchronously invokes another orchestrator as a sub-orchestration and returns aTaskthat completes when the sub-orchestration completes.See
callSubOrchestrator(String, Object, String, TaskOptions, Class)for a full description.- Parameters:
name- the name of the orchestrator to invokeinput- the serializable input to send to the sub-orchestration- Returns:
- a new
Taskthat completes when the sub-orchestration completes or fails
-
callSubOrchestrator
default <V> Task<V> callSubOrchestrator(java.lang.String name, java.lang.Object input, java.lang.Class<V> returnType)
Asynchronously invokes another orchestrator as a sub-orchestration and returns aTaskthat completes when the sub-orchestration completes.See
callSubOrchestrator(String, Object, String, TaskOptions, Class)for a full description.- Type Parameters:
V- the expected type of the sub-orchestration output- Parameters:
name- the name of the orchestrator to invokeinput- the serializable input to send to the sub-orchestrationreturnType- the expected class type of the sub-orchestration output- Returns:
- a new
Taskthat completes when the sub-orchestration completes or fails
-
callSubOrchestrator
default <V> Task<V> callSubOrchestrator(java.lang.String name, java.lang.Object input, java.lang.String instanceID, java.lang.Class<V> returnType)
Asynchronously invokes another orchestrator as a sub-orchestration and returns aTaskthat completes when the sub-orchestration completes.See
callSubOrchestrator(String, Object, String, TaskOptions, Class)for a full description.- Type Parameters:
V- the expected type of the sub-orchestration output- Parameters:
name- the name of the orchestrator to invokeinput- the serializable input to send to the sub-orchestrationinstanceID- the unique ID of the sub-orchestrationreturnType- the expected class type of the sub-orchestration output- Returns:
- a new
Taskthat completes when the sub-orchestration completes or fails
-
callSubOrchestrator
default Task<java.lang.Void> callSubOrchestrator(java.lang.String name, java.lang.Object input, java.lang.String instanceID, TaskOptions options)
Asynchronously invokes another orchestrator as a sub-orchestration and returns aTaskthat completes when the sub-orchestration completes.See
callSubOrchestrator(String, Object, String, TaskOptions, Class)for a full description.- Parameters:
name- the name of the orchestrator to invokeinput- the serializable input to send to the sub-orchestrationinstanceID- the unique ID of the sub-orchestrationoptions- additional options that control the execution and processing of the activity- Returns:
- a new
Taskthat completes when the sub-orchestration completes or fails
-
callSubOrchestrator
<V> Task<V> callSubOrchestrator(java.lang.String name, @Nullable java.lang.Object input, @Nullable java.lang.String instanceID, @Nullable TaskOptions options, java.lang.Class<V> returnType)
Asynchronously invokes another orchestrator as a sub-orchestration and returns aTaskthat completes when the sub-orchestration completes. If the sub-orchestration completes successfully, the returnedTask's value will be the activity's output. If the sub-orchestration fails, the returnedTaskwill complete exceptionally with aTaskFailedException.A sub-orchestration has its own instance ID, history, and status that is independent of the parent orchestrator that started it. There are many advantages to breaking down large orchestrations into sub-orchestrations:
- Splitting large orchestrations into a series of smaller sub-orchestrations can make code more maintainable.
- Distributing orchestration logic across multiple compute nodes concurrently is useful if orchestration logic otherwise needs to coordinate a lot of tasks.
- Memory usage and CPU overhead can be reduced by keeping the history of parent orchestrations smaller.
Because sub-orchestrations are independent of their parents, terminating a parent orchestration does not affect any sub-orchestrations. Sub-orchestrations must be terminated independently using their unique instance ID, which is specified using the
instanceIDparameter- Type Parameters:
V- the expected type of the sub-orchestration output- Parameters:
name- the name of the orchestrator to invokeinput- the serializable input to send to the sub-orchestrationinstanceID- the unique ID of the sub-orchestrationoptions- additional options that control the execution and processing of the activityreturnType- the expected class type of the sub-orchestration output- Returns:
- a new
Taskthat completes when the sub-orchestration completes or fails
-
waitForExternalEvent
<V> Task<V> waitForExternalEvent(java.lang.String name, java.time.Duration timeout, java.lang.Class<V> dataType) throws TaskCanceledException
Waits for an event to be raised namednameand returns aTaskthat completes when the event is received or is canceled whentimeoutexpires.External clients can raise events to a waiting orchestration instance using the
DurableTaskClient.raiseEvent(java.lang.String, java.lang.String)method.If the current orchestration is not yet waiting for an event named
name, then the event will be saved in the orchestration instance state and dispatched immediately when this method is called. This event saving occurs even if the current orchestrator cancels the wait operation before the event is received.Orchestrators can wait for the same event name multiple times, so waiting for multiple events with the same name is allowed. Each external event received by an orchestrator will complete just one task returned by this method.
- Type Parameters:
V- the expected type of the event data payload- Parameters:
name- the case-insensitive name of the event to wait fortimeout- the amount of time to wait before canceling the returnedTaskdataType- the expected class type of the event data payload- Returns:
- a new
Taskthat completes when the external event is received or whentimeoutexpires - Throws:
TaskCanceledException- if the specifiedtimeoutvalue expires before the event is received
-
waitForExternalEvent
default Task<java.lang.Void> waitForExternalEvent(java.lang.String name, java.time.Duration timeout) throws TaskCanceledException
Waits for an event to be raised namednameand returns aTaskthat completes when the event is received or is canceled whentimeoutexpires.See
waitForExternalEvent(String, Duration, Class)for a full description.- Parameters:
name- the case-insensitive name of the event to wait fortimeout- the amount of time to wait before canceling the returnedTask- Returns:
- a new
Taskthat completes when the external event is received or whentimeoutexpires - Throws:
TaskCanceledException- if the specifiedtimeoutvalue expires before the event is received
-
waitForExternalEvent
default Task<java.lang.Void> waitForExternalEvent(java.lang.String name)
Waits for an event to be raised namednameand returns aTaskthat completes when the event is received.See
waitForExternalEvent(String, Duration, Class)for a full description.- Parameters:
name- the case-insensitive name of the event to wait for- Returns:
- a new
Taskthat completes when the external event is received
-
waitForExternalEvent
default <V> Task<V> waitForExternalEvent(java.lang.String name, java.lang.Class<V> dataType)
Waits for an event to be raised namednameand returns aTaskthat completes when the event is received.See
waitForExternalEvent(String, Duration, Class)for a full description.- Type Parameters:
V- the expected type of the event data payload- Parameters:
name- the case-insensitive name of the event to wait fordataType- the expected class type of the event data payload- Returns:
- a new
Taskthat completes when the external event is received
-
setCustomStatus
void setCustomStatus(java.lang.Object customStatus)
Assigns a custom status value to the current orchestration.The
customStatusvalue is serialized and stored in orchestration state and will be made available to the orchestration status query APIs, such asDurableTaskClient.getInstanceMetadata(java.lang.String, boolean). The serialized value must not exceed 16 KB of UTF-16 encoded text.Use
clearCustomStatus()to remove the custom status value from the orchestration state.- Parameters:
customStatus- A serializable value to assign as the custom status value.
-
clearCustomStatus
void clearCustomStatus()
Clears the orchestration's custom status.
-
-