Interface ReplayWorkflow
public interface ReplayWorkflow
Manages event loop, workflow method, an abstraction level over Deterministic Runner to provide a
communication interface for the control thread for Start, Signal, Query, etc.
-
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()booleanOptional<io.temporal.api.common.v1.Payloads> voidhandleSignal(String signalName, Optional<io.temporal.api.common.v1.Payloads> input, long eventId, io.temporal.api.common.v1.Header header) Handle an external signal event.voidhandleUpdate(String updateName, String updateId, Optional<io.temporal.api.common.v1.Payloads> input, long eventId, io.temporal.api.common.v1.Header header, NexusSerializationContext nexusSerializationContext, UpdateProtocolCallback callbacks) Handle an update workflow execution event.Optional<io.temporal.api.common.v1.Payloads> query(io.temporal.api.query.v1.WorkflowQuery query) Called after all history is replayed and workflow cannot make any progress if workflow task is a query.voidstart(io.temporal.api.history.v1.HistoryEvent event, ReplayWorkflowContext context)
-
Method Details
-
start
-
handleSignal
-
handleUpdate
void handleUpdate(String updateName, String updateId, Optional<io.temporal.api.common.v1.Payloads> input, long eventId, io.temporal.api.common.v1.Header header, @Nullable NexusSerializationContext nexusSerializationContext, UpdateProtocolCallback callbacks) Handle an update workflow execution event.- Parameters:
nexusSerializationContext- the serialization context of the Nexus operation handler that sent the update, or null if it was not sent by one. When set, the update's result, failure and rejection, which are returned to the Nexus caller, are serialized with it.
-
eventLoop
boolean eventLoop()- Returns:
- true if the execution of the workflow method is finished or an exit was explicitly called by it
-
getOutput
Optional<io.temporal.api.common.v1.Payloads> getOutput()- Returns:
- null means no output yet
-
cancel
-
close
void close() -
query
Called after all history is replayed and workflow cannot make any progress if workflow task is a query.- Parameters:
query- arguments- Returns:
- query result
-
getWorkflowContext
WorkflowContext getWorkflowContext()- Returns:
- the fullest context of the workflow possible
-