TaskOrchestrationContext.CallSubOrchestratorAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
CallSubOrchestratorAsync(TaskName, TaskOptions) |
Executes a named sub-orchestrator and returns the result. |
CallSubOrchestratorAsync(TaskName, Object, TaskOptions) |
Executes a named sub-orchestrator. |
CallSubOrchestratorAsync<TResult>(TaskName, TaskOptions) |
Executes a named sub-orchestrator and returns the result. |
CallSubOrchestratorAsync<TResult>(TaskName, Object, TaskOptions) |
Executes a named sub-orchestrator and returns the result. |
CallSubOrchestratorAsync(TaskName, TaskOptions)
Executes a named sub-orchestrator and returns the result.
public virtual System.Threading.Tasks.Task CallSubOrchestratorAsync (Microsoft.DurableTask.TaskName orchestratorName, Microsoft.DurableTask.TaskOptions options);
abstract member CallSubOrchestratorAsync : Microsoft.DurableTask.TaskName * Microsoft.DurableTask.TaskOptions -> System.Threading.Tasks.Task
override this.CallSubOrchestratorAsync : Microsoft.DurableTask.TaskName * Microsoft.DurableTask.TaskOptions -> System.Threading.Tasks.Task
Public Overridable Function CallSubOrchestratorAsync (orchestratorName As TaskName, options As TaskOptions) As Task
Parameters
- orchestratorName
- TaskName
The name of the orchestrator to call.
- options
- TaskOptions
Additional options that control the execution and processing of the sub-orchestrator. Callers can choose to supply the derived type SubOrchestrationOptions.
Returns
A task that completes when the sub-orchestrator completes or fails.
Applies to
CallSubOrchestratorAsync(TaskName, Object, TaskOptions)
Executes a named sub-orchestrator.
public virtual System.Threading.Tasks.Task CallSubOrchestratorAsync (Microsoft.DurableTask.TaskName orchestratorName, object? input = default, Microsoft.DurableTask.TaskOptions? options = default);
abstract member CallSubOrchestratorAsync : Microsoft.DurableTask.TaskName * obj * Microsoft.DurableTask.TaskOptions -> System.Threading.Tasks.Task
override this.CallSubOrchestratorAsync : Microsoft.DurableTask.TaskName * obj * Microsoft.DurableTask.TaskOptions -> System.Threading.Tasks.Task
Public Overridable Function CallSubOrchestratorAsync (orchestratorName As TaskName, Optional input As Object = Nothing, Optional options As TaskOptions = Nothing) As Task
Parameters
- orchestratorName
- TaskName
The name of the orchestrator to call.
- input
- Object
The serializable input to pass to the sub-orchestrator.
- options
- TaskOptions
Additional options that control the execution and processing of the sub-orchestrator. Callers can choose to supply the derived type SubOrchestrationOptions.
Returns
A task that completes when the sub-orchestrator completes or fails.
Exceptions
The specified orchestrator does not exist.
Thrown if the calling thread is anything other than the main orchestrator thread.
The sub-orchestration failed with an unhandled exception. The details of the failure can be found in the FailureDetails property.
Remarks
In addition to activities, orchestrators can schedule other orchestrators, creating sub-orchestrations. A sub-orchestration has its own instance ID, history, and status that is independent of the parent orchestrator that started it.
Sub-orchestrations have many benefits:
The return value of a sub-orchestration is its output. If a sub-orchestration fails with an exception, then that exception will be surfaced to the parent orchestration, just like it is when an activity task fails with an exception. Sub-orchestrations also support automatic retry policies.
Because sub-orchestrations are independent of their parents, terminating a parent orchestration does not affect any sub-orchestrations. You must terminate each sub-orchestration independently using its instance ID, which is specified by supplying SubOrchestrationOptions in place of TaskOptions.
Applies to
CallSubOrchestratorAsync<TResult>(TaskName, TaskOptions)
Executes a named sub-orchestrator and returns the result.
public virtual System.Threading.Tasks.Task<TResult> CallSubOrchestratorAsync<TResult> (Microsoft.DurableTask.TaskName orchestratorName, Microsoft.DurableTask.TaskOptions options);
abstract member CallSubOrchestratorAsync : Microsoft.DurableTask.TaskName * Microsoft.DurableTask.TaskOptions -> System.Threading.Tasks.Task<'Result>
override this.CallSubOrchestratorAsync : Microsoft.DurableTask.TaskName * Microsoft.DurableTask.TaskOptions -> System.Threading.Tasks.Task<'Result>
Public Overridable Function CallSubOrchestratorAsync(Of TResult) (orchestratorName As TaskName, options As TaskOptions) As Task(Of TResult)
Type Parameters
- TResult
The type into which to deserialize the sub-orchestrator's output.
Parameters
- orchestratorName
- TaskName
The name of the orchestrator to call.
- options
- TaskOptions
Additional options that control the execution and processing of the sub-orchestrator. Callers can choose to supply the derived type SubOrchestrationOptions.
Returns
A task that completes when the sub-orchestrator completes or fails.
Applies to
CallSubOrchestratorAsync<TResult>(TaskName, Object, TaskOptions)
Executes a named sub-orchestrator and returns the result.
public abstract System.Threading.Tasks.Task<TResult> CallSubOrchestratorAsync<TResult> (Microsoft.DurableTask.TaskName orchestratorName, object? input = default, Microsoft.DurableTask.TaskOptions? options = default);
abstract member CallSubOrchestratorAsync : Microsoft.DurableTask.TaskName * obj * Microsoft.DurableTask.TaskOptions -> System.Threading.Tasks.Task<'Result>
Public MustOverride Function CallSubOrchestratorAsync(Of TResult) (orchestratorName As TaskName, Optional input As Object = Nothing, Optional options As TaskOptions = Nothing) As Task(Of TResult)
Type Parameters
- TResult
The type into which to deserialize the sub-orchestrator's output.
Parameters
- orchestratorName
- TaskName
The name of the orchestrator to call.
- input
- Object
The serializable input to pass to the sub-orchestrator.
- options
- TaskOptions
Additional options that control the execution and processing of the sub-orchestrator. Callers can choose to supply the derived type SubOrchestrationOptions.
Returns
A task that completes when the sub-orchestrator completes or fails.