Package io.iworkflow.core
Class Client
- java.lang.Object
-
- io.iworkflow.core.Client
-
public class Client extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Client(Registry registry, ClientOptions clientOptions)
return a full-featured client.Client(Registry registry, ClientOptions clientOptions, UnregisteredClient unregisteredClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description WorkflowInfo
describeWorkflow(java.lang.String workflowId)
Describe a workflow to get its info.WorkflowInfo
describeWorkflow(java.lang.String workflowId, java.lang.String workflowRunId)
Describe a workflow to get its info.java.util.Map<java.lang.String,java.lang.Object>
getAllDataAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId)
Get all the data attributes of a workflowjava.util.Map<java.lang.String,java.lang.Object>
getAllDataAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.lang.String workflowRunId)
Get all the data attributes of a workflowjava.util.Map<java.lang.String,java.lang.Object>
getAllSearchAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId)
Get all the search attributes of a workflowjava.util.Map<java.lang.String,java.lang.Object>
getAllSearchAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.lang.String workflowRunId)
Get all the search attributes of a workflowjava.util.List<StateCompletionOutput>
getComplexWorkflowResultWithWait(java.lang.String workflowId)
In some cases, a workflow may have more than one completion states.java.util.List<StateCompletionOutput>
getComplexWorkflowResultWithWait(java.lang.String workflowId, java.lang.String workflowRunId)
In some cases, a workflow may have more than one completion states.<T> T
getSimpleWorkflowResultWithWait(java.lang.Class<T> valueClass, java.lang.String workflowId)
Deprecated.<T> T
getSimpleWorkflowResultWithWait(java.lang.Class<T> valueClass, java.lang.String workflowId, java.lang.String workflowRunId)
Deprecated.UnregisteredClient
getUnregisteredClient()
java.util.Map<java.lang.String,java.lang.Object>
getWorkflowDataAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.lang.String workflowRunId, java.util.List<java.lang.String> keys)
Get specified data attributes (by keys) of a workflowjava.util.Map<java.lang.String,java.lang.Object>
getWorkflowDataAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.util.List<java.lang.String> keys)
Get specified data attributes (by keys) of a workflowjava.util.Map<java.lang.String,java.lang.Object>
getWorkflowSearchAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.lang.String workflowRunId, java.util.List<java.lang.String> attributeKeys)
Get specified search attributes (by attributeKeys) of a workflowjava.util.Map<java.lang.String,java.lang.Object>
getWorkflowSearchAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.util.List<java.lang.String> attributeKeys)
Get specified search attributes (by attributeKeys) of a workflow<O> O
invokeRPC(RpcDefinitions.RpcFunc0<O> rpcStubMethod)
invoking the RPC through RPC stub<O> O
invokeRPC(RpcDefinitions.RpcFunc0NoPersistence<O> rpcStubMethod)
invoking the RPC through RPC stub<I,O>
OinvokeRPC(RpcDefinitions.RpcFunc1<I,O> rpcStubMethod, I input)
invoking the RPC through RPC stub<I,O>
OinvokeRPC(RpcDefinitions.RpcFunc1NoPersistence<I,O> rpcStubMethod, I input)
invoking the RPC through RPC stubvoid
invokeRPC(RpcDefinitions.RpcProc0 rpcStubMethod)
invoking the RPC through RPC stubvoid
invokeRPC(RpcDefinitions.RpcProc0NoPersistence rpcStubMethod)
invoking the RPC through RPC stub<I> void
invokeRPC(RpcDefinitions.RpcProc1<I> rpcStubMethod, I input)
invoking the RPC through RPC stub<I> void
invokeRPC(RpcDefinitions.RpcProc1NoPersistence<I> rpcStubMethod, I input)
invoking the RPC through RPC stub<T> T
newRpcStub(java.lang.Class<T> workflowClassForRpc, java.lang.String workflowId)
create a new stub for invoking RPC<T> T
newRpcStub(java.lang.Class<T> workflowClassForRpc, java.lang.String workflowId, java.lang.String workflowRunId)
create a new stub for invoking RPCjava.lang.String
resetWorkflow(java.lang.String workflowId, ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions)
java.lang.String
resetWorkflow(java.lang.String workflowId, java.lang.String workflowRunId, ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions)
WorkflowSearchResponse
searchWorkflow(WorkflowSearchRequest request)
This search API support paginationWorkflowSearchResponse
searchWorkflow(java.lang.String query, int pageSize)
This is a simplified API to search without pagination, use the other searchWorkflow API for pagination featurevoid
signalWorkflow(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.lang.String signalChannelName, java.lang.Object signalValue)
Emit a signal message for the workflow object to receive from external sourcesvoid
signalWorkflow(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.lang.String workflowRunId, java.lang.String signalChannelName, java.lang.Object signalValue)
Emit a signal message for the workflow object to receive from external sourcesvoid
skipTimer(java.lang.String workflowId, java.lang.String workflowRunId, java.lang.Class<? extends WorkflowState> stateClass, int stateExecutionNumber, int timerCommandIndex)
void
skipTimer(java.lang.String workflowId, java.lang.String workflowRunId, java.lang.Class<? extends WorkflowState> stateClass, int stateExecutionNumber, java.lang.String timerCommandId)
void
skipTimer(java.lang.String workflowId, java.lang.String workflowRunId, java.lang.String workflowStateId, int stateExecutionNumber, int timerCommandIndex)
void
skipTimer(java.lang.String workflowId, java.lang.String workflowRunId, java.lang.String workflowStateId, int stateExecutionNumber, java.lang.String timerCommandId)
java.lang.String
startWorkflow(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, int workflowTimeoutSeconds)
startWorkflow starts a workflow executionjava.lang.String
startWorkflow(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, int workflowTimeoutSeconds, java.lang.Object input)
startWorkflow starts a workflow executionjava.lang.String
startWorkflow(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, int workflowTimeoutSeconds, java.lang.Object input, WorkflowOptions option)
startWorkflow starts a workflow executionjava.lang.String
startWorkflow(java.lang.String wfType, java.lang.String workflowId, int workflowTimeoutSeconds, java.lang.Object input, WorkflowOptions options)
startWorkflow starts a workflow executionvoid
stopWorkflow(java.lang.String workflowId)
Stop a workflow, this is essentially terminate the workflow gracefully The workflow status will be CANCELEDvoid
stopWorkflow(java.lang.String workflowId, StopWorkflowOptions options)
Stop a workflow with optionsvoid
stopWorkflow(java.lang.String workflowId, java.lang.String workflowRunId, StopWorkflowOptions options)
Stop a workflow with optionsjava.util.List<StateCompletionOutput>
tryGettingComplexWorkflowResult(java.lang.String workflowId)
In some cases, a workflow may have more than one completion states.java.util.List<StateCompletionOutput>
tryGettingComplexWorkflowResult(java.lang.String workflowId, java.lang.String workflowRunId)
In some cases, a workflow may have more than one completion states.<T> T
tryGettingSimpleWorkflowResult(java.lang.Class<T> valueClass, java.lang.String workflowId)
For most cases, a workflow only has one result(one completion state).<T> T
tryGettingSimpleWorkflowResult(java.lang.Class<T> valueClass, java.lang.String workflowId, java.lang.String workflowRunId)
For most cases, a workflow only has one result(one completion state).void
waitForStateExecutionCompletion(java.lang.String workflowId, java.lang.Class<? extends WorkflowState> stateClass)
A long poll API to wait for the completion of the state.void
waitForStateExecutionCompletion(java.lang.String workflowId, java.lang.Class<? extends WorkflowState> stateClass, int stateExecutionNumber)
A long poll API to wait for the completion of the state.void
waitForStateExecutionCompletion(java.lang.String workflowId, java.lang.Class<? extends WorkflowState> stateClass, java.lang.String waitForKey)
A long poll API to wait for the completion of the state.<T> T
waitForWorkflowCompletion(java.lang.Class<T> valueClass, java.lang.String workflowId)
A long poll API to wait for the workflow completion and return single result This only works for a workflow only has one result(one completion state).void
waitForWorkflowCompletion(java.lang.String workflowId)
A long poll API to wait for the workflow completion.
-
-
-
Constructor Detail
-
Client
public Client(Registry registry, ClientOptions clientOptions)
return a full-featured client. If you don't have the workflow Registry, you should useUnregisteredClient
instead- Parameters:
registry
- registry is required so that this client can perform some validation checks (workflow types, channel names)clientOptions
- is for configuring the client
-
Client
public Client(Registry registry, ClientOptions clientOptions, UnregisteredClient unregisteredClient)
-
-
Method Detail
-
getUnregisteredClient
public UnregisteredClient getUnregisteredClient()
-
startWorkflow
public java.lang.String startWorkflow(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, int workflowTimeoutSeconds)
startWorkflow starts a workflow execution- Parameters:
workflowClass
- is requiredworkflowId
- is requiredworkflowTimeoutSeconds
- is required- Returns:
- runId
-
startWorkflow
public java.lang.String startWorkflow(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, int workflowTimeoutSeconds, java.lang.Object input)
startWorkflow starts a workflow execution- Parameters:
workflowClass
- is requiredworkflowId
- is requiredworkflowTimeoutSeconds
- is requiredinput
- is optional, can be null- Returns:
- runId
-
startWorkflow
public java.lang.String startWorkflow(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, int workflowTimeoutSeconds, java.lang.Object input, WorkflowOptions option)
startWorkflow starts a workflow execution- Parameters:
workflowClass
- is requiredworkflowId
- is requiredworkflowTimeoutSeconds
- is requiredinput
- is optional, can be nulloption
- is optional, can be null- Returns:
- runId
-
startWorkflow
public java.lang.String startWorkflow(java.lang.String wfType, java.lang.String workflowId, int workflowTimeoutSeconds, java.lang.Object input, WorkflowOptions options)
startWorkflow starts a workflow execution- Parameters:
wfType
- is required. It should be the same as theObjectWorkflow.getWorkflowType()
workflowId
- is requiredworkflowTimeoutSeconds
- is requiredinput
- is optional, can be nulloptions
- is optional, can be null- Returns:
- runId
-
waitForWorkflowCompletion
public void waitForWorkflowCompletion(java.lang.String workflowId)
A long poll API to wait for the workflow completion. Due to the limit of REST API, it will only wait for 30 seconds for the workflow to complete. (configurable in ClientOptions.LongPollApiMaxWaitTimeSeconds) If the workflow is not COMPLETED, throw theWorkflowUncompletedException
.- Parameters:
workflowId
- required, the workflowId
-
waitForWorkflowCompletion
public <T> T waitForWorkflowCompletion(java.lang.Class<T> valueClass, java.lang.String workflowId)
A long poll API to wait for the workflow completion and return single result This only works for a workflow only has one result(one completion state). If the workflow has multiple completion states, use getComplexWorkflowResultWithWait. This API to retrieve the output of the state with waiting for the workflow to complete. If the workflow is not COMPLETED, throw theWorkflowUncompletedException
.- Type Parameters:
T
- type of the output- Parameters:
valueClass
- required, the type class of the outputworkflowId
- required, the workflowId- Returns:
- the output result
-
getSimpleWorkflowResultWithWait
@Deprecated public <T> T getSimpleWorkflowResultWithWait(java.lang.Class<T> valueClass, java.lang.String workflowId, java.lang.String workflowRunId)
Deprecated.UsewaitForWorkflowCompletion(Class, String)
instead It's just a renaming.
-
getSimpleWorkflowResultWithWait
@Deprecated public <T> T getSimpleWorkflowResultWithWait(java.lang.Class<T> valueClass, java.lang.String workflowId)
Deprecated.UsewaitForWorkflowCompletion(Class, String)
instead It's just a renaming.
-
tryGettingSimpleWorkflowResult
public <T> T tryGettingSimpleWorkflowResult(java.lang.Class<T> valueClass, java.lang.String workflowId, java.lang.String workflowRunId)
For most cases, a workflow only has one result(one completion state). Use this API to retrieve the output of the state without waiting for the workflow to complete. If the workflow is not COMPLETED, throw theWorkflowUncompletedException
. Else, return the same result asgetSimpleWorkflowResultWithWait(Class, String, String)
.- Type Parameters:
T
- type of the output- Parameters:
valueClass
- required, the type class of the outputworkflowId
- required, the workflowIdworkflowRunId
- optional, can be empty- Returns:
- the output result
-
tryGettingSimpleWorkflowResult
public <T> T tryGettingSimpleWorkflowResult(java.lang.Class<T> valueClass, java.lang.String workflowId)
For most cases, a workflow only has one result(one completion state). Use this API to retrieve the output of the state without waiting for the workflow to complete. If the workflow is not COMPLETED, throw theWorkflowUncompletedException
. Else, return the same result asgetSimpleWorkflowResultWithWait(Class, String)
.- Type Parameters:
T
- type of the output- Parameters:
valueClass
- required, the type class of the outputworkflowId
- required, the workflowId- Returns:
- the output result
-
getComplexWorkflowResultWithWait
public java.util.List<StateCompletionOutput> getComplexWorkflowResultWithWait(java.lang.String workflowId, java.lang.String workflowRunId)
In some cases, a workflow may have more than one completion states. Use this API to retrieve the output of the states with waiting for the workflow to complete. If the workflow is not COMPLETED, throw theFeignException.FeignClientException
.- Parameters:
workflowId
- required, the workflowIdworkflowRunId
- optional, can be empty- Returns:
- a list of the state output for completion states. User code will figure how to use ObjectEncoder to decode the output
-
getComplexWorkflowResultWithWait
public java.util.List<StateCompletionOutput> getComplexWorkflowResultWithWait(java.lang.String workflowId)
In some cases, a workflow may have more than one completion states. Use this API to retrieve the output of the states with waiting for the workflow to complete. If the workflow is not COMPLETED, throw theFeignException.FeignClientException
.- Parameters:
workflowId
- required, the workflowId- Returns:
- a list of the state output for completion states. User code will figure how to use ObjectEncoder to decode the output
-
tryGettingComplexWorkflowResult
public java.util.List<StateCompletionOutput> tryGettingComplexWorkflowResult(java.lang.String workflowId, java.lang.String workflowRunId)
In some cases, a workflow may have more than one completion states. Use this API to retrieve the output of the states without waiting for the workflow to complete. If the workflow is not COMPLETED, throw theWorkflowUncompletedException
. Else, return the same result asgetComplexWorkflowResultWithWait(String, String)
.- Parameters:
workflowId
- required, the workflowIdworkflowRunId
- optional, can be empty- Returns:
- a list of the state output for completion states. User code will figure how to use ObjectEncoder to decode the output
-
tryGettingComplexWorkflowResult
public java.util.List<StateCompletionOutput> tryGettingComplexWorkflowResult(java.lang.String workflowId)
In some cases, a workflow may have more than one completion states. Use this API to retrieve the output of the states without waiting for the workflow to complete. If the workflow is not COMPLETED, throw theWorkflowUncompletedException
. Else, return the same result asgetComplexWorkflowResultWithWait(String)
.- Parameters:
workflowId
- required, the workflowId- Returns:
- a list of the state output for completion states. User code will figure how to use ObjectEncoder to decode the output
-
signalWorkflow
public void signalWorkflow(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.lang.String workflowRunId, java.lang.String signalChannelName, java.lang.Object signalValue)
Emit a signal message for the workflow object to receive from external sources- Parameters:
workflowClass
- requiredworkflowId
- requiredworkflowRunId
- optional, can be emptysignalChannelName
- requiredsignalValue
- optional, can be null
-
signalWorkflow
public void signalWorkflow(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.lang.String signalChannelName, java.lang.Object signalValue)
Emit a signal message for the workflow object to receive from external sources- Parameters:
workflowClass
- requiredworkflowId
- requiredsignalChannelName
- requiredsignalValue
- optional, can be null
-
resetWorkflow
public java.lang.String resetWorkflow(java.lang.String workflowId, java.lang.String workflowRunId, ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions)
- Parameters:
workflowId
- requiredworkflowRunId
- optional, can be emptyresetWorkflowTypeAndOptions
- required, the combination parameter for reset- Returns:
- the new runId after reset
-
resetWorkflow
public java.lang.String resetWorkflow(java.lang.String workflowId, ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions)
- Parameters:
workflowId
- requiredresetWorkflowTypeAndOptions
- required, the combination parameter for reset- Returns:
- the new runId after reset
-
stopWorkflow
public void stopWorkflow(java.lang.String workflowId, java.lang.String workflowRunId, StopWorkflowOptions options)
Stop a workflow with options- Parameters:
workflowId
- requiredworkflowRunId
- optional, can be emptyoptions
- optional, can be null. If not set, the workflow status will be CANCELED
-
stopWorkflow
public void stopWorkflow(java.lang.String workflowId, StopWorkflowOptions options)
Stop a workflow with options- Parameters:
workflowId
- requiredoptions
- optional, can be null. If not set, the workflow status will be CANCELED
-
stopWorkflow
public void stopWorkflow(java.lang.String workflowId)
Stop a workflow, this is essentially terminate the workflow gracefully The workflow status will be CANCELED- Parameters:
workflowId
- required
-
getWorkflowDataAttributes
public java.util.Map<java.lang.String,java.lang.Object> getWorkflowDataAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.lang.String workflowRunId, java.util.List<java.lang.String> keys)
Get specified data attributes (by keys) of a workflow- Parameters:
workflowClass
- requiredworkflowId
- requiredworkflowRunId
- optional, can be emptykeys
- required, cannot be empty or null- Returns:
- the data attributes
-
getWorkflowDataAttributes
public java.util.Map<java.lang.String,java.lang.Object> getWorkflowDataAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.util.List<java.lang.String> keys)
Get specified data attributes (by keys) of a workflow- Parameters:
workflowClass
- requiredworkflowId
- requiredkeys
- required, cannot be empty or null- Returns:
- the data attributes
-
getAllDataAttributes
public java.util.Map<java.lang.String,java.lang.Object> getAllDataAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.lang.String workflowRunId)
Get all the data attributes of a workflow- Parameters:
workflowClass
- requiredworkflowId
- requiredworkflowRunId
- optional, can be empty- Returns:
- the data attributes
-
getAllDataAttributes
public java.util.Map<java.lang.String,java.lang.Object> getAllDataAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId)
Get all the data attributes of a workflow- Parameters:
workflowClass
- requiredworkflowId
- required- Returns:
- the data attributes
-
searchWorkflow
public WorkflowSearchResponse searchWorkflow(java.lang.String query, int pageSize)
This is a simplified API to search without pagination, use the other searchWorkflow API for pagination feature- Parameters:
query
- the query of the search, see Cadence/Temporal search attributes docpageSize
- the page size- Returns:
- the results of the search, this will only return one page of the results
-
searchWorkflow
public WorkflowSearchResponse searchWorkflow(WorkflowSearchRequest request)
This search API support pagination- Parameters:
request
- the search request- Returns:
- the results of the search
-
newRpcStub
public <T> T newRpcStub(java.lang.Class<T> workflowClassForRpc, java.lang.String workflowId, java.lang.String workflowRunId)
create a new stub for invoking RPC- Type Parameters:
T
- the class of defining the RPCs to invoke- Parameters:
workflowClassForRpc
- the class of defining the RPCs to invokeworkflowId
- requiredworkflowRunId
- optional, can be empty- Returns:
- the result of the RPC
-
newRpcStub
public <T> T newRpcStub(java.lang.Class<T> workflowClassForRpc, java.lang.String workflowId)
create a new stub for invoking RPC- Type Parameters:
T
- the class of defining the RPCs to invoke- Parameters:
workflowClassForRpc
- the class of defining the RPCs to invokeworkflowId
- required- Returns:
- the result of the RPC
-
invokeRPC
public <I,O> O invokeRPC(RpcDefinitions.RpcFunc1<I,O> rpcStubMethod, I input)
invoking the RPC through RPC stub- Type Parameters:
I
- the input typeO
- the output type- Parameters:
rpcStubMethod
- the RPC method from stub created bynewRpcStub(Class, String, String)
input
- the input of the RPC method- Returns:
- output
-
invokeRPC
public <I,O> O invokeRPC(RpcDefinitions.RpcFunc1NoPersistence<I,O> rpcStubMethod, I input)
invoking the RPC through RPC stub- Type Parameters:
I
- the input typeO
- the output type- Parameters:
rpcStubMethod
- the RPC method from stub created bynewRpcStub(Class, String, String)
input
- the input of the RPC method- Returns:
- output
-
invokeRPC
public <O> O invokeRPC(RpcDefinitions.RpcFunc0<O> rpcStubMethod)
invoking the RPC through RPC stub- Type Parameters:
O
- the output type- Parameters:
rpcStubMethod
- the RPC method from stub created bynewRpcStub(Class, String, String)
- Returns:
- output
-
invokeRPC
public <O> O invokeRPC(RpcDefinitions.RpcFunc0NoPersistence<O> rpcStubMethod)
invoking the RPC through RPC stub- Type Parameters:
O
- the output type- Parameters:
rpcStubMethod
- the RPC method from stub created bynewRpcStub(Class, String, String)
- Returns:
- output
-
invokeRPC
public <I> void invokeRPC(RpcDefinitions.RpcProc1<I> rpcStubMethod, I input)
invoking the RPC through RPC stub- Type Parameters:
I
- the input type- Parameters:
rpcStubMethod
- the RPC method from stub created bynewRpcStub(Class, String, String)
input
- the input of the RPC method
-
invokeRPC
public <I> void invokeRPC(RpcDefinitions.RpcProc1NoPersistence<I> rpcStubMethod, I input)
invoking the RPC through RPC stub- Type Parameters:
I
- the input type- Parameters:
rpcStubMethod
- the RPC method from stub created bynewRpcStub(Class, String, String)
input
- the input of the RPC method
-
invokeRPC
public void invokeRPC(RpcDefinitions.RpcProc0 rpcStubMethod)
invoking the RPC through RPC stub- Parameters:
rpcStubMethod
- the RPC method from stub created bynewRpcStub(Class, String, String)
-
invokeRPC
public void invokeRPC(RpcDefinitions.RpcProc0NoPersistence rpcStubMethod)
invoking the RPC through RPC stub- Parameters:
rpcStubMethod
- the RPC method from stub created bynewRpcStub(Class, String, String)
-
getWorkflowSearchAttributes
public java.util.Map<java.lang.String,java.lang.Object> getWorkflowSearchAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.lang.String workflowRunId, java.util.List<java.lang.String> attributeKeys)
Get specified search attributes (by attributeKeys) of a workflow- Parameters:
workflowClass
- requiredworkflowId
- requiredworkflowRunId
- optional, can be emptyattributeKeys
- required, cannot be empty or null- Returns:
- the search attributes
-
getWorkflowSearchAttributes
public java.util.Map<java.lang.String,java.lang.Object> getWorkflowSearchAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.util.List<java.lang.String> attributeKeys)
Get specified search attributes (by attributeKeys) of a workflow- Parameters:
workflowClass
- requiredworkflowId
- requiredattributeKeys
- required, cannot be empty or null- Returns:
- the search attributes
-
getAllSearchAttributes
public java.util.Map<java.lang.String,java.lang.Object> getAllSearchAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId, java.lang.String workflowRunId)
Get all the search attributes of a workflow- Parameters:
workflowClass
- requiredworkflowId
- requiredworkflowRunId
- optional, can be empty- Returns:
- the search attributes
-
getAllSearchAttributes
public java.util.Map<java.lang.String,java.lang.Object> getAllSearchAttributes(java.lang.Class<? extends ObjectWorkflow> workflowClass, java.lang.String workflowId)
Get all the search attributes of a workflow- Parameters:
workflowClass
- requiredworkflowId
- required- Returns:
- the search attributes
-
describeWorkflow
public WorkflowInfo describeWorkflow(java.lang.String workflowId, java.lang.String workflowRunId)
Describe a workflow to get its info. If the workflow does not exist, throw the WORKFLOW_NOT_EXISTS_SUB_STATUS exception.- Parameters:
workflowId
- requiredworkflowRunId
- optional, can be empty- Returns:
- the workflow's info
-
describeWorkflow
public WorkflowInfo describeWorkflow(java.lang.String workflowId)
Describe a workflow to get its info. If the workflow does not exist, throw the WORKFLOW_NOT_EXISTS_SUB_STATUS exception.- Parameters:
workflowId
- required- Returns:
- the workflow's info
-
skipTimer
public void skipTimer(java.lang.String workflowId, java.lang.String workflowRunId, java.lang.Class<? extends WorkflowState> stateClass, int stateExecutionNumber, java.lang.String timerCommandId)
-
skipTimer
public void skipTimer(java.lang.String workflowId, java.lang.String workflowRunId, java.lang.String workflowStateId, int stateExecutionNumber, java.lang.String timerCommandId)
-
skipTimer
public void skipTimer(java.lang.String workflowId, java.lang.String workflowRunId, java.lang.Class<? extends WorkflowState> stateClass, int stateExecutionNumber, int timerCommandIndex)
-
skipTimer
public void skipTimer(java.lang.String workflowId, java.lang.String workflowRunId, java.lang.String workflowStateId, int stateExecutionNumber, int timerCommandIndex)
-
waitForStateExecutionCompletion
public void waitForStateExecutionCompletion(java.lang.String workflowId, java.lang.Class<? extends WorkflowState> stateClass)
A long poll API to wait for the completion of the state. This only waits for the first completion. Note 1 The stateCompletion to wait for is needed to registered on starting workflow due to limitation in https://github.com/indeedeng/iwf/issues/349 Note 2 The max polling time is configured as clientOptions as the Feign client timeout(default to 10s) If the state is not COMPLETED, throw theClientSideException
with the sub status ofErrorSubStatus.LONG_POLL_TIME_OUT_SUB_STATUS
- Parameters:
workflowId
- the workflowIdstateClass
- the state class.
-
waitForStateExecutionCompletion
public void waitForStateExecutionCompletion(java.lang.String workflowId, java.lang.Class<? extends WorkflowState> stateClass, java.lang.String waitForKey)
A long poll API to wait for the completion of the state. This only waits for the first completion. Note 1 The stateCompletion and stateExecutionNumber to wait for must be registered on starting workflow due to limitation in https://github.com/indeedeng/iwf/issues/349 Note 2 The max polling time is configured as clientOptions as the Feign client timeout(default to 10s) If the state is not COMPLETED, throw theClientSideException
with the sub status ofErrorSubStatus.LONG_POLL_TIME_OUT_SUB_STATUS
- Parameters:
workflowId
- the workflowIdstateClass
- the state classwaitForKey
- key provided by the client and to identity workflow
-
waitForStateExecutionCompletion
public void waitForStateExecutionCompletion(java.lang.String workflowId, java.lang.Class<? extends WorkflowState> stateClass, int stateExecutionNumber)
A long poll API to wait for the completion of the state. This only waits for the first completion. Note 1 The stateCompletion and stateExecutionNumber to wait for must be registered on starting workflow due to limitation in https://github.com/indeedeng/iwf/issues/349 Note 2 The max polling time is configured as clientOptions as the Feign client timeout(default to 10s) If the state is not COMPLETED, throw theClientSideException
with the sub status ofErrorSubStatus.LONG_POLL_TIME_OUT_SUB_STATUS
- Parameters:
workflowId
- the workflowIdstateClass
- the state classstateExecutionNumber
- the state execution number. E.g. if it's 2, it means the 2nd execution of the state
-
-