Class WorkflowRunOperation
java.lang.Object
io.temporal.nexus.WorkflowRunOperation
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
Modifier and TypeMethodDescriptionstatic <T,R> io.nexusrpc.handler.OperationHandler <T, R> fromWorkflowHandle(WorkflowHandleFactory<T, R> handleFactory) Maps a workflow handle to anOperationHandler.static <T,R> io.nexusrpc.handler.OperationHandler <T, R> fromWorkflowMethod(WorkflowMethodFactory<T, R> startMethod) Maps a workflow method to anOperationHandler.
-
Method Details
-
fromWorkflowMethod
public static <T,R> io.nexusrpc.handler.OperationHandler<T,R> fromWorkflowMethod(WorkflowMethodFactory<T, R> startMethod) Maps a workflow method to anOperationHandler.- 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 anOperationHandler.- Parameters:
handleFactory- returns the workflow handle that will be mapped to the call- Returns:
- Operation handler to be used as an
OperationImpl
-