Class 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 Detail

      • UnregisteredClient

        public UnregisteredClient​(ClientOptions clientOptions)
    • Method Detail

      • getLastOutgoingWorkflowRpcRequest

        public WorkflowRpcRequest getLastOutgoingWorkflowRpcRequest()
      • startWorkflow

        public java.lang.String startWorkflow​(java.lang.String workflowType,
                                              java.lang.String startStateId,
                                              java.lang.String workflowId,
                                              int workflowTimeoutSeconds)
        Parameters:
        workflowType - required
        startStateId - required
        workflowId - required
        workflowTimeoutSeconds - 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 - required
        startStateId - required
        workflowId - required
        workflowTimeoutSeconds - required
        input - 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 - required
        startStateId - required
        workflowId - required
        workflowTimeoutSeconds - required
        input - optional, can be null
        options - 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 the FeignException.FeignClientException.
        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
      • 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 the FeignException.FeignClientException.
        Type Parameters:
        T - type of the output
        Parameters:
        valueClass - required, the type class of the output
        workflowId - 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 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
      • waitForStateExecutionCompletion

        public void waitForStateExecutionCompletion​(java.lang.String workflowId,
                                                    java.lang.String stateExecutionId)
      • waitForStateExecutionCompletion

        public void waitForStateExecutionCompletion​(java.lang.String workflowId,
                                                    java.lang.String stateId,
                                                    java.lang.String waitForKey)
      • 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 - workflowId
        workflowRunId - workflowRunId
        resetWorkflowTypeAndOptions - 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 - required
        workflowRunId - optional
      • stopWorkflow

        public void stopWorkflow​(java.lang.String workflowId,
                                 java.lang.String workflowRunId,
                                 StopWorkflowOptions options)
        Stop a workflow with options
        Parameters:
        workflowId - required
        workflowRunId - optional
        options - optional
      • getAnyWorkflowDataObjects

        public WorkflowGetDataObjectsResponse getAnyWorkflowDataObjects​(java.lang.String workflowId,
                                                                        java.lang.String workflowRunId,
                                                                        java.util.List<java.lang.String> attributeKeys)
        Parameters:
        workflowId - workflowId
        workflowRunId - workflowRunId
        attributeKeys - , 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 - required
        workflowRunId - optional
        needsResults - 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)
      • 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)