Package io.iworkflow.core
Class Client
java.lang.Object
io.iworkflow.core.Client
-
Constructor Summary
ConstructorsConstructorDescriptionClient
(Registry registry, ClientOptions clientOptions) return a full-featured client.Client
(Registry registry, ClientOptions clientOptions, UnregisteredClient unregisteredClient) -
Method Summary
Modifier and TypeMethodDescriptiondescribeWorkflow
(String workflowId) Describe a workflow to get its info.describeWorkflow
(String workflowId, String workflowRunId) Describe a workflow to get its info.getAllDataAttributes
(Class<? extends ObjectWorkflow> workflowClass, String workflowId) Get all the data attributes of a workflowgetAllDataAttributes
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId) Get all the data attributes of a workflowgetAllSearchAttributes
(Class<? extends ObjectWorkflow> workflowClass, String workflowId) Get all the search attributes of a workflowgetAllSearchAttributes
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId) Get all the search attributes of a workflowgetComplexWorkflowResultWithWait
(String workflowId) In some cases, a workflow may have more than one completion states.getComplexWorkflowResultWithWait
(String workflowId, String workflowRunId) In some cases, a workflow may have more than one completion states.<T> T
getSimpleWorkflowResultWithWait
(Class<T> valueClass, String workflowId) Deprecated.<T> T
getSimpleWorkflowResultWithWait
(Class<T> valueClass, String workflowId, String workflowRunId) Deprecated.getWorkflowDataAttributes
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId, List<String> keys) Get specified data attributes (by keys) of a workflowgetWorkflowDataAttributes
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, List<String> keys) Get specified data attributes (by keys) of a workflowgetWorkflowSearchAttributes
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId, List<String> attributeKeys) Get specified search attributes (by attributeKeys) of a workflowgetWorkflowSearchAttributes
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, List<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> O invokeRPC
(RpcDefinitions.RpcFunc1<I, O> rpcStubMethod, I input) invoking the RPC through RPC stub<I,
O> O invokeRPC
(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
(Class<T> workflowClassForRpc, String workflowId) create a new stub for invoking RPC<T> T
newRpcStub
(Class<T> workflowClassForRpc, String workflowId, String workflowRunId) create a new stub for invoking RPCresetWorkflow
(String workflowId, ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions) resetWorkflow
(String workflowId, String workflowRunId, ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions) searchWorkflow
(WorkflowSearchRequest request) This search API support paginationsearchWorkflow
(String query, int pageSize) This is a simplified API to search without pagination, use the other searchWorkflow API for pagination featurevoid
setWorkflowDataAttributes
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId, Map<String, Object> dataAttributes) Set the value for data attributes aka objects for a workflowvoid
setWorkflowDataAttributes
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, Map<String, Object> dataAttributes) Set the value for data attributes aka objects for a workflowvoid
setWorkflowSearchAttributes
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId, List<SearchAttribute> searchAttributes) Set the value of search attributes for a workflowvoid
setWorkflowSearchAttributes
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, List<SearchAttribute> searchAttributes) Set the value of search attributes for a workflowvoid
signalWorkflow
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String signalChannelName, Object signalValue) Emit a signal message for the workflow object to receive from external sourcesvoid
signalWorkflow
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId, String signalChannelName, Object signalValue) Emit a signal message for the workflow object to receive from external sourcesvoid
skipTimer
(String workflowId, String workflowRunId, Class<? extends WorkflowState> stateClass, int stateExecutionNumber, int timerCommandIndex) void
skipTimer
(String workflowId, String workflowRunId, Class<? extends WorkflowState> stateClass, int stateExecutionNumber, String timerCommandId) void
skipTimer
(String workflowId, String workflowRunId, String workflowStateId, int stateExecutionNumber, int timerCommandIndex) void
skipTimer
(String workflowId, String workflowRunId, String workflowStateId, int stateExecutionNumber, String timerCommandId) startWorkflow
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, int workflowTimeoutSeconds) startWorkflow starts a workflow executionstartWorkflow
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, int workflowTimeoutSeconds, Object input) startWorkflow starts a workflow executionstartWorkflow
(Class<? extends ObjectWorkflow> workflowClass, String workflowId, int workflowTimeoutSeconds, Object input, WorkflowOptions option) startWorkflow starts a workflow executionstartWorkflow
(String wfType, String workflowId, int workflowTimeoutSeconds, Object input, WorkflowOptions options) startWorkflow starts a workflow executionvoid
stopWorkflow
(String workflowId) Stop a workflow, this is essentially terminate the workflow gracefully The workflow status will be CANCELEDvoid
stopWorkflow
(String workflowId, StopWorkflowOptions options) Stop a workflow with optionsvoid
stopWorkflow
(String workflowId, String workflowRunId, StopWorkflowOptions options) Stop a workflow with optionstryGettingComplexWorkflowResult
(String workflowId) In some cases, a workflow may have more than one completion states.tryGettingComplexWorkflowResult
(String workflowId, String workflowRunId) In some cases, a workflow may have more than one completion states.<T> T
tryGettingSimpleWorkflowResult
(Class<T> valueClass, String workflowId) For most cases, a workflow only has one result(one completion state).<T> T
tryGettingSimpleWorkflowResult
(Class<T> valueClass, String workflowId, String workflowRunId) For most cases, a workflow only has one result(one completion state).void
waitForStateExecutionCompletion
(String workflowId, Class<? extends WorkflowState> stateClass) A long poll API to wait for the completion of the state.void
waitForStateExecutionCompletion
(String workflowId, Class<? extends WorkflowState> stateClass, int stateExecutionNumber) A long poll API to wait for the completion of the state.void
waitForStateExecutionCompletion
(String workflowId, Class<? extends WorkflowState> stateClass, String waitForKey) A long poll API to wait for the completion of the state.<T> T
waitForWorkflowCompletion
(Class<T> valueClass, 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
(String workflowId) A long poll API to wait for the workflow completion.
-
Constructor Details
-
Client
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 Details
-
getUnregisteredClient
-
startWorkflow
public String startWorkflow(Class<? extends ObjectWorkflow> workflowClass, String workflowId, int workflowTimeoutSeconds) startWorkflow starts a workflow execution- Parameters:
workflowClass
- is requiredworkflowId
- is requiredworkflowTimeoutSeconds
- is required- Returns:
- runId
- Throws:
WorkflowAlreadyStartedException
- if the workflow is already started
-
startWorkflow
public String startWorkflow(Class<? extends ObjectWorkflow> workflowClass, String workflowId, int workflowTimeoutSeconds, Object input) startWorkflow starts a workflow execution- Parameters:
workflowClass
- is requiredworkflowId
- is requiredworkflowTimeoutSeconds
- is requiredinput
- is optional, can be null- Returns:
- runId
- Throws:
WorkflowAlreadyStartedException
- if the workflow is already started
-
startWorkflow
public String startWorkflow(Class<? extends ObjectWorkflow> workflowClass, String workflowId, int workflowTimeoutSeconds, 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
- Throws:
WorkflowAlreadyStartedException
- if the workflow is already started. If using WorkflowAlreadyStartedOptions in WorkflowOptions, the error will be ignored if ignoreAlreadyStartedError is true. If ignoreAlreadyStartedError is true and also requestId is set, the requestId will be used to identify the request. The error will only be thrown if the requestId is different from the requestId of the existing workflow.
-
startWorkflow
public String startWorkflow(String wfType, String workflowId, int workflowTimeoutSeconds, 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
- Throws:
WorkflowAlreadyStartedException
- if the workflow is already started. If using WorkflowAlreadyStartedOptions in WorkflowOptions, the error will be ignored if ignoreAlreadyStartedError is true. If ignoreAlreadyStartedError is true and also requestId is set, the requestId will be used to identify the request. The error will only be thrown if the requestId is different from the requestId of the existing workflow.
-
waitForWorkflowCompletion
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)- Parameters:
workflowId
- required, the workflowId- Throws:
WorkflowUncompletedException
- if the workflow is not COMPLETEDWorkflowNotExistsException
- if the workflow is not existingLongPollTimeoutException
- if the long poll timeout
-
waitForWorkflowCompletion
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
- Throws:
WorkflowUncompletedException
- if the workflow is not COMPLETEDWorkflowNotExistsException
- if the workflow is not existingLongPollTimeoutException
- if the long poll timeout
-
getSimpleWorkflowResultWithWait
@Deprecated public <T> T getSimpleWorkflowResultWithWait(Class<T> valueClass, String workflowId, String workflowRunId) Deprecated.UsewaitForWorkflowCompletion(Class, String)
instead It's just a renaming.- 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
- Throws:
WorkflowUncompletedException
- if the workflow is not COMPLETEDWorkflowNotExistsException
- if the workflow is not existingLongPollTimeoutException
- if the long poll timeout
-
getSimpleWorkflowResultWithWait
Deprecated.UsewaitForWorkflowCompletion(Class, String)
instead It's just a renaming.- Type Parameters:
T
- type of the output- Parameters:
valueClass
- required, the type class of the outputworkflowId
- required, the workflowId- Returns:
- the output result
- Throws:
WorkflowUncompletedException
- if the workflow is not COMPLETEDWorkflowNotExistsException
- if the workflow is not existingLongPollTimeoutException
- if the long poll timeout
-
tryGettingSimpleWorkflowResult
public <T> T tryGettingSimpleWorkflowResult(Class<T> valueClass, String workflowId, 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.- 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
- Throws:
WorkflowUncompletedException
- if the workflow is not COMPLETEDWorkflowNotExistsException
- if the workflow is not existing
-
tryGettingSimpleWorkflowResult
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.- Type Parameters:
T
- type of the output- Parameters:
valueClass
- required, the type class of the outputworkflowId
- required, the workflowId- Returns:
- the output result
- Throws:
WorkflowUncompletedException
- if the workflow is not COMPLETEDWorkflowNotExistsException
- if the workflow is not existing
-
getComplexWorkflowResultWithWait
public List<StateCompletionOutput> getComplexWorkflowResultWithWait(String workflowId, 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.- 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
- Throws:
WorkflowUncompletedException
- if the workflow is not COMPLETEDWorkflowNotExistsException
- if the workflow is not existingLongPollTimeoutException
- if the long poll timeout
-
getComplexWorkflowResultWithWait
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.- 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
- Throws:
WorkflowUncompletedException
- if the workflow is not COMPLETEDWorkflowNotExistsException
- if the workflow is not existingLongPollTimeoutException
- if the long poll timeout
-
tryGettingComplexWorkflowResult
public List<StateCompletionOutput> tryGettingComplexWorkflowResult(String workflowId, 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.- 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
- Throws:
WorkflowUncompletedException
- if the workflow is not COMPLETEDWorkflowNotExistsException
- if the workflow is not existing
-
tryGettingComplexWorkflowResult
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.- 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
- Throws:
WorkflowUncompletedException
- if the workflow is not COMPLETEDWorkflowNotExistsException
- if the workflow is not existing
-
signalWorkflow
public void signalWorkflow(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId, String signalChannelName, 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- Throws:
NoRunningWorkflowException
- if the workflow is not existing or not running
-
signalWorkflow
public void signalWorkflow(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String signalChannelName, Object signalValue) Emit a signal message for the workflow object to receive from external sources- Parameters:
workflowClass
- requiredworkflowId
- requiredsignalChannelName
- requiredsignalValue
- optional, can be null- Throws:
NoRunningWorkflowException
- if the workflow is not existing or not running
-
resetWorkflow
public String resetWorkflow(String workflowId, String workflowRunId, ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions) - Parameters:
workflowId
- requiredworkflowRunId
- optional, can be emptyresetWorkflowTypeAndOptions
- required, the combination parameter for reset- Returns:
- the new runId after reset
- Throws:
WorkflowNotExistsException
- if the workflow is not existing
-
resetWorkflow
public String resetWorkflow(String workflowId, ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions) - Parameters:
workflowId
- requiredresetWorkflowTypeAndOptions
- required, the combination parameter for reset- Returns:
- the new runId after reset
- Throws:
WorkflowNotExistsException
- if the workflow is not existing
-
stopWorkflow
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- Throws:
NoRunningWorkflowException
- if the workflow is not existing or not running
-
stopWorkflow
Stop a workflow with options- Parameters:
workflowId
- requiredoptions
- optional, can be null. If not set, the workflow status will be CANCELED- Throws:
NoRunningWorkflowException
- if the workflow is not existing or not running
-
stopWorkflow
Stop a workflow, this is essentially terminate the workflow gracefully The workflow status will be CANCELED- Parameters:
workflowId
- required- Throws:
NoRunningWorkflowException
- if the workflow is not existing or not running
-
getWorkflowDataAttributes
public Map<String,Object> getWorkflowDataAttributes(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId, List<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
- Throws:
WorkflowNotExistsException
- if the workflow is not existing
-
getWorkflowDataAttributes
public Map<String,Object> getWorkflowDataAttributes(Class<? extends ObjectWorkflow> workflowClass, String workflowId, List<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
- Throws:
WorkflowNotExistsException
- if the workflow is not existing
-
getAllDataAttributes
public Map<String,Object> getAllDataAttributes(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId) Get all the data attributes of a workflow- Parameters:
workflowClass
- requiredworkflowId
- requiredworkflowRunId
- optional, can be empty- Returns:
- the data attributes
- Throws:
WorkflowNotExistsException
- if the workflow is not existing
-
getAllDataAttributes
public Map<String,Object> getAllDataAttributes(Class<? extends ObjectWorkflow> workflowClass, String workflowId) Get all the data attributes of a workflow- Parameters:
workflowClass
- requiredworkflowId
- required- Returns:
- the data attributes
- Throws:
WorkflowNotExistsException
- if the workflow is not existing
-
setWorkflowDataAttributes
public void setWorkflowDataAttributes(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId, Map<String, Object> dataAttributes) Set the value for data attributes aka objects for a workflow- Parameters:
workflowClass
- requiredworkflowId
- requiredworkflowRunId
- optional, can be emptydataAttributes
- required- Throws:
NoRunningWorkflowException
- if the workflow is not existing or not running
-
setWorkflowDataAttributes
public void setWorkflowDataAttributes(Class<? extends ObjectWorkflow> workflowClass, String workflowId, Map<String, Object> dataAttributes) Set the value for data attributes aka objects for a workflow- Parameters:
workflowClass
- requiredworkflowId
- requireddataAttributes
- required- Throws:
NoRunningWorkflowException
- if the workflow is not existing or not running
-
searchWorkflow
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
This search API support pagination- Parameters:
request
- the search request- Returns:
- the results of the search
-
newRpcStub
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
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
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
- Throws:
WorkflowNotExistsException
- if the workflow is not existing, or not running to accept a write operation in RPC
-
invokeRPC
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
- Throws:
WorkflowNotExistsException
- if the workflow is not existing, or not running to accept a write operation in RPC
-
invokeRPC
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
- Throws:
WorkflowNotExistsException
- if the workflow is not existing, or not running to accept a write operation in RPC
-
invokeRPC
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
- Throws:
WorkflowNotExistsException
- if the workflow is not existing, or not running to accept a write operation in RPC
-
invokeRPC
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- Throws:
WorkflowNotExistsException
- if the workflow is not existing, or not running to accept a write operation in RPC
-
invokeRPC
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- Throws:
WorkflowNotExistsException
- if the workflow is not existing, or not running to accept a write operation in RPC
-
invokeRPC
invoking the RPC through RPC stub- Parameters:
rpcStubMethod
- the RPC method from stub created bynewRpcStub(Class, String, String)
- Throws:
WorkflowNotExistsException
- if the workflow is not existing, or not running to accept a write operation in RPC
-
invokeRPC
invoking the RPC through RPC stub- Parameters:
rpcStubMethod
- the RPC method from stub created bynewRpcStub(Class, String, String)
- Throws:
WorkflowNotExistsException
- if the workflow is not existing, or not running to accept a write operation in RPC
-
getWorkflowSearchAttributes
public Map<String,Object> getWorkflowSearchAttributes(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId, List<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
- Throws:
WorkflowNotExistsException
- if the workflow is not existing
-
getWorkflowSearchAttributes
public Map<String,Object> getWorkflowSearchAttributes(Class<? extends ObjectWorkflow> workflowClass, String workflowId, List<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
- Throws:
WorkflowNotExistsException
- if the workflow is not existing
-
getAllSearchAttributes
public Map<String,Object> getAllSearchAttributes(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId) Get all the search attributes of a workflow- Parameters:
workflowClass
- requiredworkflowId
- requiredworkflowRunId
- optional, can be empty- Returns:
- the search attributes
- Throws:
WorkflowNotExistsException
- if the workflow is not existing
-
setWorkflowSearchAttributes
public void setWorkflowSearchAttributes(Class<? extends ObjectWorkflow> workflowClass, String workflowId, List<SearchAttribute> searchAttributes) Set the value of search attributes for a workflow- Parameters:
workflowClass
- requiredworkflowId
- requiredsearchAttributes
- required- Throws:
NoRunningWorkflowException
- if the workflow is not existing or not running
-
setWorkflowSearchAttributes
public void setWorkflowSearchAttributes(Class<? extends ObjectWorkflow> workflowClass, String workflowId, String workflowRunId, List<SearchAttribute> searchAttributes) Set the value of search attributes for a workflow- Parameters:
workflowClass
- requiredworkflowId
- requiredworkflowRunId
- optional, can be emptysearchAttributes
- required- Throws:
NoRunningWorkflowException
- if the workflow is not existing or not running
-
getAllSearchAttributes
public Map<String,Object> getAllSearchAttributes(Class<? extends ObjectWorkflow> workflowClass, String workflowId) Get all the search attributes of a workflow- Parameters:
workflowClass
- requiredworkflowId
- required- Returns:
- the search attributes
- Throws:
WorkflowNotExistsException
- if the workflow is not existing
-
describeWorkflow
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
- Throws:
WorkflowNotExistsException
- if the workflow is not existing
-
describeWorkflow
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
- Throws:
WorkflowNotExistsException
- if the workflow is not existing
-
skipTimer
public void skipTimer(String workflowId, String workflowRunId, Class<? extends WorkflowState> stateClass, int stateExecutionNumber, String timerCommandId) -
skipTimer
-
skipTimer
public void skipTimer(String workflowId, String workflowRunId, Class<? extends WorkflowState> stateClass, int stateExecutionNumber, int timerCommandIndex) -
skipTimer
-
waitForStateExecutionCompletion
public void waitForStateExecutionCompletion(String workflowId, 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)- Parameters:
workflowId
- the workflowIdstateClass
- the state class.- Throws:
LongPollTimeoutException
- if the long poll timeoutWorkflowNotExistsException
- if the workflow is not existing
-
waitForStateExecutionCompletion
public void waitForStateExecutionCompletion(String workflowId, Class<? extends WorkflowState> stateClass, 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- Throws:
LongPollTimeoutException
- if the long poll timeoutWorkflowNotExistsException
- if the workflow is not existing
-
waitForStateExecutionCompletion
public void waitForStateExecutionCompletion(String workflowId, 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- Throws:
LongPollTimeoutException
- if the long poll timeoutWorkflowNotExistsException
- if the workflow is not existing
-