Class Client

java.lang.Object
io.iworkflow.core.Client

public class Client extends Object
  • Constructor Details

    • Client

      public Client(Registry registry, ClientOptions clientOptions)
      return a full-featured client. If you don't have the workflow Registry, you should use UnregisteredClient 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

      public UnregisteredClient getUnregisteredClient()
    • startWorkflow

      public String startWorkflow(Class<? extends ObjectWorkflow> workflowClass, String workflowId, int workflowTimeoutSeconds)
      startWorkflow starts a workflow execution
      Parameters:
      workflowClass - is required
      workflowId - is required
      workflowTimeoutSeconds - 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 required
      workflowId - is required
      workflowTimeoutSeconds - is required
      input - 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 required
      workflowId - is required
      workflowTimeoutSeconds - is required
      input - is optional, can be null
      option - 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 the ObjectWorkflow.getWorkflowType()
      workflowId - is required
      workflowTimeoutSeconds - is required
      input - is optional, can be null
      options - 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

      public void waitForWorkflowCompletion(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)
      Parameters:
      workflowId - required, the workflowId
      Throws:
      WorkflowUncompletedException - if the workflow is not COMPLETED
      WorkflowNotExistsException - if the workflow is not existing
      LongPollTimeoutException - if the long poll timeout
    • waitForWorkflowCompletion

      public <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). 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 the WorkflowUncompletedException.
      Type Parameters:
      T - type of the output
      Parameters:
      valueClass - required, the type class of the output
      workflowId - required, the workflowId
      Returns:
      the output result
      Throws:
      WorkflowUncompletedException - if the workflow is not COMPLETED
      WorkflowNotExistsException - if the workflow is not existing
      LongPollTimeoutException - if the long poll timeout
    • getSimpleWorkflowResultWithWait

      @Deprecated public <T> T getSimpleWorkflowResultWithWait(Class<T> valueClass, String workflowId, String workflowRunId)
      Deprecated.
      Use waitForWorkflowCompletion(Class, String) instead It's just a renaming.
      Type Parameters:
      T - type of the output
      Parameters:
      valueClass - required, the type class of the output
      workflowId - required, the workflowId
      workflowRunId - optional, can be empty
      Returns:
      the output result
      Throws:
      WorkflowUncompletedException - if the workflow is not COMPLETED
      WorkflowNotExistsException - if the workflow is not existing
      LongPollTimeoutException - if the long poll timeout
    • getSimpleWorkflowResultWithWait

      @Deprecated public <T> T getSimpleWorkflowResultWithWait(Class<T> valueClass, String workflowId)
      Deprecated.
      Use waitForWorkflowCompletion(Class, String) instead It's just a renaming.
      Type Parameters:
      T - type of the output
      Parameters:
      valueClass - required, the type class of the output
      workflowId - required, the workflowId
      Returns:
      the output result
      Throws:
      WorkflowUncompletedException - if the workflow is not COMPLETED
      WorkflowNotExistsException - if the workflow is not existing
      LongPollTimeoutException - 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 output
      workflowId - required, the workflowId
      workflowRunId - optional, can be empty
      Returns:
      the output result
      Throws:
      WorkflowUncompletedException - if the workflow is not COMPLETED
      WorkflowNotExistsException - if the workflow is not existing
    • tryGettingSimpleWorkflowResult

      public <T> T tryGettingSimpleWorkflowResult(Class<T> valueClass, 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.
      Type Parameters:
      T - type of the output
      Parameters:
      valueClass - required, the type class of the output
      workflowId - required, the workflowId
      Returns:
      the output result
      Throws:
      WorkflowUncompletedException - if the workflow is not COMPLETED
      WorkflowNotExistsException - 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 workflowId
      workflowRunId - 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 COMPLETED
      WorkflowNotExistsException - if the workflow is not existing
      LongPollTimeoutException - if the long poll timeout
    • getComplexWorkflowResultWithWait

      public List<StateCompletionOutput> getComplexWorkflowResultWithWait(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.
      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 COMPLETED
      WorkflowNotExistsException - if the workflow is not existing
      LongPollTimeoutException - 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 workflowId
      workflowRunId - 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 COMPLETED
      WorkflowNotExistsException - if the workflow is not existing
    • tryGettingComplexWorkflowResult

      public List<StateCompletionOutput> tryGettingComplexWorkflowResult(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.
      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 COMPLETED
      WorkflowNotExistsException - 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 - required
      workflowId - required
      workflowRunId - optional, can be empty
      signalChannelName - required
      signalValue - 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 - required
      workflowId - required
      signalChannelName - required
      signalValue - 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 - required
      workflowRunId - optional, can be empty
      resetWorkflowTypeAndOptions - 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 - required
      resetWorkflowTypeAndOptions - required, the combination parameter for reset
      Returns:
      the new runId after reset
      Throws:
      WorkflowNotExistsException - if the workflow is not existing
    • stopWorkflow

      public void stopWorkflow(String workflowId, String workflowRunId, StopWorkflowOptions options)
      Stop a workflow with options
      Parameters:
      workflowId - required
      workflowRunId - optional, can be empty
      options - 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

      public void stopWorkflow(String workflowId, StopWorkflowOptions options)
      Stop a workflow with options
      Parameters:
      workflowId - required
      options - 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

      public void stopWorkflow(String workflowId)
      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 - required
      workflowId - required
      workflowRunId - optional, can be empty
      keys - 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 - required
      workflowId - required
      keys - 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 - required
      workflowId - required
      workflowRunId - 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 - required
      workflowId - 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 - required
      workflowId - required
      workflowRunId - optional, can be empty
      dataAttributes - 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 - required
      workflowId - required
      dataAttributes - required
      Throws:
      NoRunningWorkflowException - if the workflow is not existing or not running
    • searchWorkflow

      public WorkflowSearchResponse searchWorkflow(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 doc
      pageSize - 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(Class<T> workflowClassForRpc, String workflowId, 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 invoke
      workflowId - required
      workflowRunId - optional, can be empty
      Returns:
      the result of the RPC
    • newRpcStub

      public <T> T newRpcStub(Class<T> workflowClassForRpc, 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 invoke
      workflowId - 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 type
      O - the output type
      Parameters:
      rpcStubMethod - the RPC method from stub created by newRpcStub(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

      public <I, O> O invokeRPC(RpcDefinitions.RpcFunc1NoPersistence<I,O> rpcStubMethod, I input)
      invoking the RPC through RPC stub
      Type Parameters:
      I - the input type
      O - the output type
      Parameters:
      rpcStubMethod - the RPC method from stub created by newRpcStub(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

      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 by newRpcStub(Class, String, String)
      Returns:
      output
      Throws:
      WorkflowNotExistsException - if the workflow is not existing, or not running to accept a write operation in RPC
    • 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 by newRpcStub(Class, String, String)
      Returns:
      output
      Throws:
      WorkflowNotExistsException - if the workflow is not existing, or not running to accept a write operation in RPC
    • 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 by newRpcStub(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

      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 by newRpcStub(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

      public void invokeRPC(RpcDefinitions.RpcProc0 rpcStubMethod)
      invoking the RPC through RPC stub
      Parameters:
      rpcStubMethod - the RPC method from stub created by newRpcStub(Class, String, String)
      Throws:
      WorkflowNotExistsException - if the workflow is not existing, or not running to accept a write operation in RPC
    • invokeRPC

      public void invokeRPC(RpcDefinitions.RpcProc0NoPersistence rpcStubMethod)
      invoking the RPC through RPC stub
      Parameters:
      rpcStubMethod - the RPC method from stub created by newRpcStub(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 - required
      workflowId - required
      workflowRunId - optional, can be empty
      attributeKeys - 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 - required
      workflowId - required
      attributeKeys - 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 - required
      workflowId - required
      workflowRunId - 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 - required
      workflowId - required
      searchAttributes - 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 - required
      workflowId - required
      workflowRunId - optional, can be empty
      searchAttributes - 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 - required
      workflowId - required
      Returns:
      the search attributes
      Throws:
      WorkflowNotExistsException - if the workflow is not existing
    • describeWorkflow

      public WorkflowInfo describeWorkflow(String workflowId, 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 - required
      workflowRunId - optional, can be empty
      Returns:
      the workflow's info
      Throws:
      WorkflowNotExistsException - if the workflow is not existing
    • describeWorkflow

      public WorkflowInfo describeWorkflow(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
      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

      public void skipTimer(String workflowId, String workflowRunId, String workflowStateId, int stateExecutionNumber, String timerCommandId)
    • skipTimer

      public void skipTimer(String workflowId, String workflowRunId, Class<? extends WorkflowState> stateClass, int stateExecutionNumber, int timerCommandIndex)
    • skipTimer

      public void skipTimer(String workflowId, String workflowRunId, String workflowStateId, int stateExecutionNumber, int timerCommandIndex)
    • 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 workflowId
      stateClass - the state class.
      Throws:
      LongPollTimeoutException - if the long poll timeout
      WorkflowNotExistsException - 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 the ClientSideException with the sub status of ErrorSubStatus.LONG_POLL_TIME_OUT_SUB_STATUS
      Parameters:
      workflowId - the workflowId
      stateClass - the state class
      waitForKey - key provided by the client and to identity workflow
      Throws:
      LongPollTimeoutException - if the long poll timeout
      WorkflowNotExistsException - 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 the ClientSideException with the sub status of ErrorSubStatus.LONG_POLL_TIME_OUT_SUB_STATUS
      Parameters:
      workflowId - the workflowId
      stateClass - the state class
      stateExecutionNumber - the state execution number. E.g. if it's 2, it means the 2nd execution of the state
      Throws:
      LongPollTimeoutException - if the long poll timeout
      WorkflowNotExistsException - if the workflow is not existing