Class WorkflowRunOperation


  • public final class WorkflowRunOperation
    extends java.lang.Object
    WorkflowRunOperation can be used to map a workflow run to a Nexus operation

    Pre-release feature: Attaching multiple Nexus callers to an underlying handler Workflow:

    WorkflowOptions.getWorkflowIdConflictPolicy() is by default set to fail if a workflow is already running. That is, if a caller executes another operation that starts the same workflow, it will fail. You can set it to WorkflowIdConflictPolicy.WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING to attach the caller's callback to the existing running workflow. This way, all attached callers will be notified when the workflow completes.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T,​R>
      io.nexusrpc.handler.OperationHandler<T,​R>
      fromWorkflowHandle​(WorkflowHandleFactory<T,​R> handleFactory)
      Maps a workflow handle to an OperationHandler.
      static <T,​R>
      io.nexusrpc.handler.OperationHandler<T,​R>
      fromWorkflowMethod​(WorkflowMethodFactory<T,​R> startMethod)
      Maps a workflow method to an OperationHandler.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • fromWorkflowMethod

        public static <T,​R> io.nexusrpc.handler.OperationHandler<T,​R> fromWorkflowMethod​(WorkflowMethodFactory<T,​R> startMethod)
        Maps a workflow method to an OperationHandler.
        Parameters:
        startMethod - returns the workflow method reference to call
        Returns:
        Operation handler to be used as an OperationImpl
      • fromWorkflowHandle

        public static <T,​R> io.nexusrpc.handler.OperationHandler<T,​R> fromWorkflowHandle​(WorkflowHandleFactory<T,​R> handleFactory)
        Maps a workflow handle to an OperationHandler.
        Parameters:
        handleFactory - returns the workflow handle that will be mapped to the call
        Returns:
        Operation handler to be used as an OperationImpl