Interface WorkflowClient
-
Method Summary
Modifier and TypeMethodDescription<T,R> ComponentMethodRef <R> method(akka.japi.function.Function<T, Workflow.Effect<R>> methodRef) Pass in a Workflow command handler method reference, e.g.<T,A1, R> ComponentMethodRef1 <A1, R> method(akka.japi.function.Function2<T, A1, Workflow.Effect<R>> methodRef) Pass in a Workflow command handler method reference, e.g.<T,R> ComponentStreamMethodRef <R> notificationStream(akka.japi.function.Function<T, NotificationPublisher.NotificationStream<R>> methodRef) Pass in a Workflow notification stream getter method reference, e.g.akka.DoneResume the workflow identified by this client's workflow id.CompletionStage<akka.Done> resumeAsync(Class<? extends Workflow<?>> workflowClass) Async variant ofresume(Class).akka.DoneSuspend the workflow identified by this client's workflow id.akka.DoneSuspend the workflow identified by this client's workflow id, recording a free-form reason.CompletionStage<akka.Done> suspendAsync(Class<? extends Workflow<?>> workflowClass) Async variant ofsuspend(Class).CompletionStage<akka.Done> suspendAsync(Class<? extends Workflow<?>> workflowClass, String reason) Async variant ofsuspend(Class, String).akka.DoneTerminate the workflow identified by this client's workflow id.akka.DoneTerminate the workflow identified by this client's workflow id, recording a free-form reason.CompletionStage<akka.Done> terminateAsync(Class<? extends Workflow<?>> workflowClass) Async variant ofterminate(Class).CompletionStage<akka.Done> terminateAsync(Class<? extends Workflow<?>> workflowClass, String reason) Async variant ofterminate(Class, String).
-
Method Details
-
method
Pass in a Workflow command handler method reference, e.g.MyWorkflow::start -
method
<T,A1, ComponentMethodRef1<A1,R> R> method(akka.japi.function.Function2<T, A1, Workflow.Effect<R>> methodRef) Pass in a Workflow command handler method reference, e.g.MyWorkflow::start -
notificationStream
<T,R> ComponentStreamMethodRef<R> notificationStream(akka.japi.function.Function<T, NotificationPublisher.NotificationStream<R>> methodRef) Pass in a Workflow notification stream getter method reference, e.g.MyWorkflow::updates -
terminate
Terminate the workflow identified by this client's workflow id. Termination stops the workflow immediately (including any in-flight step), cancels pause/step/workflow-timeout timers, and moves the workflow into a terminalTerminatedstate from which no further transitions are possible. The call is idempotent — terminating an already-finished workflow is a no-op.- Parameters:
workflowClass- the Workflow class, used to resolve the component id the runtime needs to route the termination command.
-
terminateAsync
Async variant ofterminate(Class). -
terminate
Terminate the workflow identified by this client's workflow id, recording a free-form reason. An emptyreasonis equivalent toterminate(Class).The reason is short, human-readable text — same guidance as the paused-workflow reason. It is persisted in the workflow's event journal and written to runtime logs at termination time, so it MUST NOT contain secrets or PII.
On a workflow that is already in a terminal state, the call is a successful no-op and the previously-recorded reason (if any) is not overwritten.
- Parameters:
workflowClass- the Workflow class, used to resolve the component id.reason- free-form reason. Must not benull.
-
terminateAsync
CompletionStage<akka.Done> terminateAsync(Class<? extends Workflow<?>> workflowClass, String reason) Async variant ofterminate(Class, String). -
suspend
Suspend the workflow identified by this client's workflow id. Suspension behaves like termination in that the workflow does not wait for an in-flight step to complete: any result it produces after the suspend takes effect is ignored. Onresume(Class), execution restarts at the step that was in flight, giving it a fresh chance to run. The call is idempotent — suspending an already-suspended workflow is a no-op.Timeouts remain active while a workflow is suspended:
- If a workflow timeout fires while suspended, the workflow fails with a timeout.
- If a workflow timeout with a failover step fires while suspended, the failover step is executed on resume.
- If a pause timer fires while suspended, the configured timeout handler is called on resume.
While suspended, the workflow is passivated and does not consume any runtime resources.
- Parameters:
workflowClass- the Workflow class, used to resolve the component id the runtime needs to route the suspend command.
-
suspendAsync
Async variant ofsuspend(Class). -
suspend
Suspend the workflow identified by this client's workflow id, recording a free-form reason. An emptyreasonis equivalent tosuspend(Class).The reason is short, human-readable text — same guidance as the paused-workflow reason. It is persisted in the workflow's event journal and written to runtime logs at suspend time, so it MUST NOT contain secrets or PII.
On a workflow that is already suspended, the call is a successful no-op and the previously-recorded reason (if any) is not overwritten.
- Parameters:
workflowClass- the Workflow class, used to resolve the component id.reason- free-form reason. Must not benull.
-
suspendAsync
Async variant ofsuspend(Class, String). -
resume
Resume the workflow identified by this client's workflow id. Resumption is only meaningful against a workflow currently in theSuspendedstate — execution restarts at the step that was in flight at suspend time, giving it a fresh chance to run. If a workflow timeout with a failover step fired while suspended, the failover step is executed on resume; if a pause timer fired while suspended, the configured timeout handler is called on resume. The call is idempotent on a non-suspended workflow: it is a successful no-op.- Parameters:
workflowClass- the Workflow class, used to resolve the component id the runtime needs to route the resume command.
-
resumeAsync
Async variant ofresume(Class).
-