public interface WorkflowStub
WorkflowClient.newUntypedWorkflowStub(String, WorkflowOptions)
or WorkflowClient.newUntypedWorkflowStub(WorkflowExecution, Optional)
.Modifier and Type | Method and Description |
---|---|
void |
cancel()
Request cancellation of a workflow execution.
|
static <T> WorkflowStub |
fromTyped(T typed)
Extracts untyped WorkflowStub from a typed workflow stub created through
WorkflowClient.newWorkflowStub(Class, WorkflowOptions) . |
io.temporal.api.common.v1.WorkflowExecution |
getExecution() |
java.util.Optional<WorkflowOptions> |
getOptions() |
<R> R |
getResult(java.lang.Class<R> resultClass)
Returns workflow result potentially waiting for workflow to complete.
|
<R> R |
getResult(java.lang.Class<R> resultClass,
java.lang.reflect.Type resultType)
Returns workflow result potentially waiting for workflow to complete.
|
<R> R |
getResult(long timeout,
java.util.concurrent.TimeUnit unit,
java.lang.Class<R> resultClass)
Returns workflow result potentially waiting for workflow to complete.
|
<R> R |
getResult(long timeout,
java.util.concurrent.TimeUnit unit,
java.lang.Class<R> resultClass,
java.lang.reflect.Type resultType)
Returns workflow result potentially waiting for workflow to complete.
|
<R> java.util.concurrent.CompletableFuture<R> |
getResultAsync(java.lang.Class<R> resultClass) |
<R> java.util.concurrent.CompletableFuture<R> |
getResultAsync(java.lang.Class<R> resultClass,
java.lang.reflect.Type resultType) |
<R> java.util.concurrent.CompletableFuture<R> |
getResultAsync(long timeout,
java.util.concurrent.TimeUnit unit,
java.lang.Class<R> resultClass) |
<R> java.util.concurrent.CompletableFuture<R> |
getResultAsync(long timeout,
java.util.concurrent.TimeUnit unit,
java.lang.Class<R> resultClass,
java.lang.reflect.Type resultType) |
java.util.Optional<java.lang.String> |
getWorkflowType() |
<R> R |
query(java.lang.String queryType,
java.lang.Class<R> resultClass,
java.lang.Object... args)
Synchronously queries workflow by invoking its query handler.
|
<R> R |
query(java.lang.String queryType,
java.lang.Class<R> resultClass,
java.lang.reflect.Type resultType,
java.lang.Object... args) |
void |
signal(java.lang.String signalName,
java.lang.Object... args) |
io.temporal.api.common.v1.WorkflowExecution |
signalWithStart(java.lang.String signalName,
java.lang.Object[] signalArgs,
java.lang.Object[] startArgs) |
io.temporal.api.common.v1.WorkflowExecution |
start(java.lang.Object... args) |
void |
terminate(java.lang.String reason,
java.lang.Object... details)
Terminates a workflow execution.
|
static <T> WorkflowStub fromTyped(T typed)
WorkflowClient.newWorkflowStub(Class, WorkflowOptions)
.T
- type of the workflow stub interfacetyped
- typed workflow stubvoid signal(java.lang.String signalName, java.lang.Object... args)
io.temporal.api.common.v1.WorkflowExecution start(java.lang.Object... args)
io.temporal.api.common.v1.WorkflowExecution signalWithStart(java.lang.String signalName, java.lang.Object[] signalArgs, java.lang.Object[] startArgs)
java.util.Optional<java.lang.String> getWorkflowType()
io.temporal.api.common.v1.WorkflowExecution getExecution()
<R> R getResult(java.lang.Class<R> resultClass, java.lang.reflect.Type resultType)
R
- type of the workflow return valueresultClass
- class of the workflow return valueresultType
- type of the workflow return value. Differs from resultClass for generic
types.<R> java.util.concurrent.CompletableFuture<R> getResultAsync(java.lang.Class<R> resultClass, java.lang.reflect.Type resultType)
<R> R getResult(java.lang.Class<R> resultClass)
R
- type of the workflow return valueresultClass
- class of the workflow return value<R> java.util.concurrent.CompletableFuture<R> getResultAsync(java.lang.Class<R> resultClass)
<R> R getResult(long timeout, java.util.concurrent.TimeUnit unit, java.lang.Class<R> resultClass, java.lang.reflect.Type resultType) throws java.util.concurrent.TimeoutException
R
- type of the workflow return valuetimeout
- maximum time to waitunit
- unit of timeoutresultClass
- class of the workflow return valueresultType
- type of the workflow return value. Differs from resultClass for genericjava.util.concurrent.TimeoutException
- if workflow is not completed after the timeout time.<R> R getResult(long timeout, java.util.concurrent.TimeUnit unit, java.lang.Class<R> resultClass) throws java.util.concurrent.TimeoutException
R
- type of the workflow return valuetimeout
- maximum time to waitunit
- unit of timeoutresultClass
- class of the workflow return valuejava.util.concurrent.TimeoutException
- if workflow is not completed after the timeout time.<R> java.util.concurrent.CompletableFuture<R> getResultAsync(long timeout, java.util.concurrent.TimeUnit unit, java.lang.Class<R> resultClass, java.lang.reflect.Type resultType)
<R> java.util.concurrent.CompletableFuture<R> getResultAsync(long timeout, java.util.concurrent.TimeUnit unit, java.lang.Class<R> resultClass)
<R> R query(java.lang.String queryType, java.lang.Class<R> resultClass, java.lang.Object... args)
QueryMethod
.R
- type of the query resultqueryType
- name of the query handler. Usually it is a method name.resultClass
- class of the query result typeargs
- optional query argumentsWorkflowQueryException
- if query failed for any reasonWorkflowClientOptions.Builder.setQueryRejectCondition(QueryRejectCondition)
<R> R query(java.lang.String queryType, java.lang.Class<R> resultClass, java.lang.reflect.Type resultType, java.lang.Object... args)
void cancel()
Cancellation cancels CancellationScope
that wraps the main
workflow method. Note that workflow can take long time to get canceled or even completely
ignore the cancellation request.
void terminate(java.lang.String reason, java.lang.Object... details)
Termination is a hard stop of a workflow execution which doesn't give workflow code any chance to perform cleanup.
reason
- for the termination requestdetails
- additional details about the termination reasonjava.util.Optional<WorkflowOptions> getOptions()