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 Details

    • fromTyped

      static <T> ChildWorkflowStub fromTyped(T typed)
      Extracts untyped WorkflowStub from a typed workflow stub created through Workflow.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

      <R> R execute(Class<R> resultClass, 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(Class<R> resultClass, Type resultType, 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(Class<R> resultClass, 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(Class<R> resultClass, Type resultType, 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(String signalName, Object... args)
      Synchronously signals a workflow by invoking its signal handler. Usually a signal handler is a method annotated with SignalMethod.
      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.