Interface ChildWorkflowStub
public interface ChildWorkflowStub
Supports starting and signalling child workflows by the name and list of arguments. This is
useful when a child workflow type is not known at the compile time and to call child workflows in
other languages.
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<R> RSynchronously starts a child workflow execution and waits for its result.<R> RSynchronously starts a child workflow execution and waits for its result.<R> Promise<R> executeAsync(Class<R> resultClass, Object... args) Executes a child workflow asynchronously.<R> Promise<R> executeAsync(Class<R> resultClass, Type resultType, Object... args) Executes a child workflow asynchronously.static <T> ChildWorkflowStubfromTyped(T typed) Extracts untyped WorkflowStub from a typed workflow stub created throughWorkflow.newChildWorkflowStub(Class).Promise<io.temporal.api.common.v1.WorkflowExecution> If workflow completes before this promise is ready then the child might not start at all.voidSynchronously signals a workflow by invoking its signal handler.
-
Method Details
-
fromTyped
Extracts untyped WorkflowStub from a typed workflow stub created throughWorkflow.newChildWorkflowStub(Class).- Type Parameters:
T- type of the workflow stub interface- Parameters:
typed- typed workflow stub- Returns:
- untyped workflow stub for the same workflow instance.
-
getWorkflowType
String getWorkflowType()- Returns:
- workflow type name.
-
getExecution
Promise<io.temporal.api.common.v1.WorkflowExecution> getExecution()If workflow completes before this promise is ready then the child might not start at all.- Returns:
- promise that becomes ready once the child has started.
-
getOptions
ChildWorkflowOptions getOptions()- Returns:
- child workflow options used to create this stub.
-
execute
-
execute
Synchronously starts a child workflow execution and waits for its result.- Type Parameters:
R- return type.- Parameters:
resultClass- the expected return class of the workflow.resultType- the expected return class of the workflow. Differs from resultClass for generic types.args- workflow arguments.- Returns:
- workflow result.
-
executeAsync
-
executeAsync
Executes a child workflow asynchronously.- Type Parameters:
R- return type.- Parameters:
resultClass- the expected return type of the workflow.resultType- the expected return class of the workflow. Differs from resultClass for generic types.args- arguments of the activity.- Returns:
- Promise to the activity result.
-
signal
Synchronously signals a workflow by invoking its signal handler. Usually a signal handler is a method annotated withSignalMethod.- Parameters:
signalName- name of the signal handler. Usually it is a method name.args- signal method arguments.- Throws:
SignalExternalWorkflowException- if there is failure to signal the workflow.
-