Package io.iworkflow.core
Class UnregisteredClient
- java.lang.Object
-
- io.iworkflow.core.UnregisteredClient
-
public class UnregisteredClient extends java.lang.Object
UntypedClient will let you invoke the APIs to iWF server without much type validation checks(workflow type, signalChannelName, etc). It's useful for calling Client APIs without workflow registry(which may require to have all the workflow dependencies)
-
-
Constructor Summary
Constructors Constructor Description UnregisteredClient(ClientOptions clientOptions)
UnregisteredClient(ClientOptions clientOptions, DefaultApi openApiClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkflowGetDataObjectsResponse
getAnyWorkflowDataObjects(java.lang.String workflowId, java.lang.String workflowRunId, java.util.List<java.lang.String> attributeKeys)
WorkflowGetDataObjectsResponse
getAnyWorkflowDataObjects(java.lang.String workflowId, java.lang.String workflowRunId, java.util.List<java.lang.String> attributeKeys, boolean usingMemoForDataAttributes)
WorkflowGetSearchAttributesResponse
getAnyWorkflowSearchAttributes(java.lang.String workflowId, java.lang.String workflowRunId, java.util.List<SearchAttributeKeyAndType> attributeKeys)
java.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)
For most cases, a workflow only has one result(one completion state).<T> T
getSimpleWorkflowResultWithWait(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).WorkflowGetResponse
getWorkflow(java.lang.String workflowId, java.lang.String workflowRunId, java.lang.Boolean needsResults)
Get a workflow's status and results(if completed & requested).<T> T
invokeRpc(java.lang.Class<T> valueClass, java.lang.Object input, java.lang.String workflowId, java.lang.String workflowRunId, java.lang.String rpcName, int timeoutSeconds, PersistenceLoadingPolicy dataAttributesLoadingPolicy, PersistenceLoadingPolicy searchAttributesLoadingPolicy)
<T> T
invokeRpc(java.lang.Class<T> valueClass, java.lang.Object input, java.lang.String workflowId, java.lang.String workflowRunId, java.lang.String rpcName, int timeoutSeconds, PersistenceLoadingPolicy dataAttributesLoadingPolicy, PersistenceLoadingPolicy searchAttributesLoadingPolicy, boolean usingMemoForDataAttributes, java.util.List<SearchAttributeKeyAndType> allSearchAttributes)
java.lang.String
resetWorkflow(java.lang.String workflowId, java.lang.String workflowRunId, ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions)
WorkflowSearchResponse
searchWorkflow(WorkflowSearchRequest request)
WorkflowSearchResponse
searchWorkflow(java.lang.String query, int pageSize)
void
signalWorkflow(java.lang.String workflowId, java.lang.String workflowRunId, java.lang.String signalChannelName, java.lang.Object signalValue)
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.String workflowType, java.lang.String startStateId, java.lang.String workflowId, int workflowTimeoutSeconds)
java.lang.String
startWorkflow(java.lang.String workflowType, java.lang.String startStateId, java.lang.String workflowId, int workflowTimeoutSeconds, java.lang.Object input)
java.lang.String
startWorkflow(java.lang.String workflowType, java.lang.String startStateId, java.lang.String workflowId, int workflowTimeoutSeconds, java.lang.Object input, UnregisteredWorkflowOptions options)
void
stopWorkflow(java.lang.String workflowId, java.lang.String workflowRunId)
Stop a workflow, this is essentially cancel the workflow gracefullyvoid
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).<T> T
waitForStateExecutionCompletion(java.lang.Class<T> valueClass, java.lang.String workflowId, java.lang.String stateExecutionId)
-
-
-
Constructor Detail
-
UnregisteredClient
public UnregisteredClient(ClientOptions clientOptions)
-
UnregisteredClient
public UnregisteredClient(ClientOptions clientOptions, DefaultApi openApiClient)
-
-
Method Detail
-
startWorkflow
public java.lang.String startWorkflow(java.lang.String workflowType, java.lang.String startStateId, java.lang.String workflowId, int workflowTimeoutSeconds)
- Parameters:
workflowType
- requiredstartStateId
- requiredworkflowId
- requiredworkflowTimeoutSeconds
- required- Returns:
- runId
-
startWorkflow
public java.lang.String startWorkflow(java.lang.String workflowType, java.lang.String startStateId, java.lang.String workflowId, int workflowTimeoutSeconds, java.lang.Object input)
- Parameters:
workflowType
- requiredstartStateId
- requiredworkflowId
- requiredworkflowTimeoutSeconds
- requiredinput
- optional, can be null- Returns:
- runId
-
startWorkflow
public java.lang.String startWorkflow(java.lang.String workflowType, java.lang.String startStateId, java.lang.String workflowId, int workflowTimeoutSeconds, java.lang.Object input, UnregisteredWorkflowOptions options)
- Parameters:
workflowType
- requiredstartStateId
- requiredworkflowId
- requiredworkflowTimeoutSeconds
- requiredinput
- optional, can be nulloptions
- optional, can be null- Returns:
- runId
-
getSimpleWorkflowResultWithWait
public <T> T getSimpleWorkflowResultWithWait(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 with waiting for the workflow to complete. If the workflow is not COMPLETED, throw theFeignException.FeignClientException
.- 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
-
getSimpleWorkflowResultWithWait
public <T> T getSimpleWorkflowResultWithWait(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 with waiting for the workflow to complete. If the workflow is not COMPLETED, throw theFeignException.FeignClientException
.- Type Parameters:
T
- type of the output- Parameters:
valueClass
- required, the type class of the outputworkflowId
- required, the workflowId- Returns:
- the output result
-
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
-
waitForStateExecutionCompletion
public <T> T waitForStateExecutionCompletion(java.lang.Class<T> valueClass, java.lang.String workflowId, java.lang.String stateExecutionId)
-
signalWorkflow
public void signalWorkflow(java.lang.String workflowId, java.lang.String workflowRunId, java.lang.String signalChannelName, java.lang.Object signalValue)
-
resetWorkflow
public java.lang.String resetWorkflow(java.lang.String workflowId, java.lang.String workflowRunId, ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions)
- Parameters:
workflowId
- workflowIdworkflowRunId
- workflowRunIdresetWorkflowTypeAndOptions
- the combination parameter for reset- Returns:
- the new runId after reset
-
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.String workflowStateId, int stateExecutionNumber, int timerCommandIndex)
-
stopWorkflow
public void stopWorkflow(java.lang.String workflowId, java.lang.String workflowRunId)
Stop a workflow, this is essentially cancel the workflow gracefully- Parameters:
workflowId
- requiredworkflowRunId
- optional
-
stopWorkflow
public void stopWorkflow(java.lang.String workflowId, java.lang.String workflowRunId, StopWorkflowOptions options)
Stop a workflow with options- Parameters:
workflowId
- requiredworkflowRunId
- optionaloptions
- optional
-
getAnyWorkflowDataObjects
public WorkflowGetDataObjectsResponse getAnyWorkflowDataObjects(java.lang.String workflowId, java.lang.String workflowRunId, java.util.List<java.lang.String> attributeKeys)
- Parameters:
workflowId
- workflowIdworkflowRunId
- workflowRunIdattributeKeys
- , return all attributes if this is empty or null- Returns:
- the response
-
getWorkflow
public WorkflowGetResponse getWorkflow(java.lang.String workflowId, java.lang.String workflowRunId, java.lang.Boolean needsResults)
Get a workflow's status and results(if completed & requested). If the workflow does not exist, throw the WORKFLOW_NOT_EXISTS_SUB_STATUS exception.- Parameters:
workflowId
- requiredworkflowRunId
- optionalneedsResults
- result will be returned if this is true and workflow is completed- Returns:
- the workflow's status and results
-
getAnyWorkflowDataObjects
public WorkflowGetDataObjectsResponse getAnyWorkflowDataObjects(java.lang.String workflowId, java.lang.String workflowRunId, java.util.List<java.lang.String> attributeKeys, boolean usingMemoForDataAttributes)
-
searchWorkflow
public WorkflowSearchResponse searchWorkflow(java.lang.String query, int pageSize)
-
searchWorkflow
public WorkflowSearchResponse searchWorkflow(WorkflowSearchRequest request)
-
getAnyWorkflowSearchAttributes
public WorkflowGetSearchAttributesResponse getAnyWorkflowSearchAttributes(java.lang.String workflowId, java.lang.String workflowRunId, java.util.List<SearchAttributeKeyAndType> attributeKeys)
-
invokeRpc
public <T> T invokeRpc(java.lang.Class<T> valueClass, java.lang.Object input, java.lang.String workflowId, java.lang.String workflowRunId, java.lang.String rpcName, int timeoutSeconds, PersistenceLoadingPolicy dataAttributesLoadingPolicy, PersistenceLoadingPolicy searchAttributesLoadingPolicy)
-
invokeRpc
public <T> T invokeRpc(java.lang.Class<T> valueClass, java.lang.Object input, java.lang.String workflowId, java.lang.String workflowRunId, java.lang.String rpcName, int timeoutSeconds, PersistenceLoadingPolicy dataAttributesLoadingPolicy, PersistenceLoadingPolicy searchAttributesLoadingPolicy, boolean usingMemoForDataAttributes, java.util.List<SearchAttributeKeyAndType> allSearchAttributes)
-
-