Package io.temporal.workflow
Interface ChildWorkflowStub
-
public interface ChildWorkflowStubSupports 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:
Workflow.newChildWorkflowStub(Class)
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <R> Rexecute(java.lang.Class<R> resultClass, java.lang.Object... args)Synchronously starts a child workflow execution and waits for its result.<R> Rexecute(java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.lang.Object... args)Synchronously starts a child workflow execution and waits for its result.<R> Promise<R>executeAsync(java.lang.Class<R> resultClass, java.lang.Object... args)Executes a child workflow asynchronously.<R> Promise<R>executeAsync(java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.lang.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>getExecution()If workflow completes before this promise is ready then the child might not start at all.ChildWorkflowOptionsgetOptions()java.lang.StringgetWorkflowType()voidsignal(java.lang.String signalName, java.lang.Object... args)Synchronously signals a workflow by invoking its signal handler.
-
-
-
Method Detail
-
fromTyped
static <T> ChildWorkflowStub fromTyped(T typed)
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
java.lang.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
<R> R execute(java.lang.Class<R> resultClass, java.lang.Object... args)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.args- workflow arguments.- Returns:
- workflow result.
-
execute
<R> R execute(java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.lang.Object... args)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
<R> Promise<R> executeAsync(java.lang.Class<R> resultClass, java.lang.Object... args)
Executes a child workflow asynchronously.- Type Parameters:
R- return type.- Parameters:
resultClass- the expected return type of the workflow.args- arguments of the activity.- Returns:
- Promise to the activity result.
-
executeAsync
<R> Promise<R> executeAsync(java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.lang.Object... args)
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
void signal(java.lang.String signalName, java.lang.Object... args)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.
-
-