Interface ExternalWorkflowStub


public interface ExternalWorkflowStub
Supports signalling and cancelling any workflow by the workflow type and their id. This is useful when an external workflow type is not known at compile time and to call workflows in other languages.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Request cancellation of the workflow execution.
    void
    cancel(String reason)
    Request cancellation of the workflow execution with a reason.
    fromTyped(T typed)
    Extracts untyped ExternalWorkflowStub from a typed workflow stub created through Workflow.newExternalWorkflowStub(Class, String).
    io.temporal.api.common.v1.WorkflowExecution
     
    void
    signal(String signalName, Object... args)
    Synchronously signals a workflow by invoking its signal handler.
  • Method Details

    • fromTyped

      static <T> ExternalWorkflowStub fromTyped(T typed)
      Extracts untyped ExternalWorkflowStub from a typed workflow stub created through Workflow.newExternalWorkflowStub(Class, String).
      Type Parameters:
      T - type of the workflow stub interface
      Parameters:
      typed - typed external workflow stub
      Returns:
      untyped external workflow stub for the same workflow instance.
    • getExecution

      io.temporal.api.common.v1.WorkflowExecution getExecution()
      Returns:
      workflow execution used to create this stub.
    • 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.
    • cancel

      void cancel()
      Request cancellation of the workflow execution.
    • cancel

      void cancel(@Nullable String reason)
      Request cancellation of the workflow execution with a reason.
      Parameters:
      reason - optional reason for cancellation.