Class Client


  • public class Client
    extends java.lang.Object
    • 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 workflow
      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
      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
      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
      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)
      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 workflow
      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
      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
      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
      <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 stub
      void invokeRPC​(RpcDefinitions.RpcProc0 rpcStubMethod)
      invoking the RPC through RPC stub
      void 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 RPC
      java.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 pagination
      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
      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
      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
      void 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 execution
      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
      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
      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
      void stopWorkflow​(java.lang.String workflowId)
      Stop a workflow, this is essentially terminate the workflow gracefully The workflow status will be CANCELED
      void stopWorkflow​(java.lang.String workflowId, StopWorkflowOptions options)
      Stop a workflow with options
      void stopWorkflow​(java.lang.String workflowId, java.lang.String workflowRunId, StopWorkflowOptions options)
      Stop a workflow with options
      java.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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
    • Method Detail

      • 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 required
        workflowId - is required
        workflowTimeoutSeconds - 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 required
        workflowId - is required
        workflowTimeoutSeconds - is required
        input - 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 required
        workflowId - is required
        workflowTimeoutSeconds - is required
        input - is optional, can be null
        option - 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 the ObjectWorkflow.getWorkflowType()
        workflowId - is required
        workflowTimeoutSeconds - is required
        input - is optional, can be null
        options - 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 the WorkflowUncompletedException.
        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 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
      • getSimpleWorkflowResultWithWait

        @Deprecated
        public <T> T getSimpleWorkflowResultWithWait​(java.lang.Class<T> valueClass,
                                                     java.lang.String workflowId,
                                                     java.lang.String workflowRunId)
        Deprecated.
        Use waitForWorkflowCompletion(Class, String) instead It's just a renaming.
      • getSimpleWorkflowResultWithWait

        @Deprecated
        public <T> T getSimpleWorkflowResultWithWait​(java.lang.Class<T> valueClass,
                                                     java.lang.String workflowId)
        Deprecated.
        Use waitForWorkflowCompletion(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 the WorkflowUncompletedException. Else, return the same result as getSimpleWorkflowResultWithWait(Class, String, String).
        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
      • 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 the WorkflowUncompletedException. Else, return the same result as getSimpleWorkflowResultWithWait(Class, String).
        Type Parameters:
        T - type of the output
        Parameters:
        valueClass - required, the type class of the output
        workflowId - 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 the FeignException.FeignClientException.
        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
      • 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 the FeignException.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 the WorkflowUncompletedException. Else, return the same result as getComplexWorkflowResultWithWait(String, String).
        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
      • 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 the WorkflowUncompletedException. Else, return the same result as getComplexWorkflowResultWithWait(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 - required
        workflowId - required
        workflowRunId - optional, can be empty
        signalChannelName - required
        signalValue - 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 - required
        workflowId - required
        signalChannelName - required
        signalValue - optional, can be null
      • resetWorkflow

        public java.lang.String resetWorkflow​(java.lang.String workflowId,
                                              java.lang.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
      • resetWorkflow

        public java.lang.String resetWorkflow​(java.lang.String workflowId,
                                              ResetWorkflowTypeAndOptions resetWorkflowTypeAndOptions)
        Parameters:
        workflowId - required
        resetWorkflowTypeAndOptions - 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 - required
        workflowRunId - optional, can be empty
        options - 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 - required
        options - 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 - required
        workflowId - required
        workflowRunId - optional, can be empty
        keys - 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 - required
        workflowId - required
        keys - 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 - required
        workflowId - required
        workflowRunId - 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 - required
        workflowId - 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 doc
        pageSize - the page size
        Returns:
        the results of the search, this will only return one page of the results
      • 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 invoke
        workflowId - required
        workflowRunId - 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 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
      • 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
      • 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
      • 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 - required
        workflowId - required
        workflowRunId - optional, can be empty
        attributeKeys - 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 - required
        workflowId - required
        attributeKeys - 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 - required
        workflowId - required
        workflowRunId - 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 - required
        workflowId - 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 - required
        workflowRunId - 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 the ClientSideException with the sub status of ErrorSubStatus.LONG_POLL_TIME_OUT_SUB_STATUS
        Parameters:
        workflowId - the workflowId
        stateClass - 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 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
      • 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 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