Interface WorkflowRunTaskHandler


  • public interface WorkflowRunTaskHandler
    Task handler that encapsulates a cached workflow and can handle multiple calls to handleWorkflowTask for the same workflow run.

    Instances of this object can be cached in between workflow tasks.

    • Method Detail

      • handleWorkflowTask

        WorkflowTaskResult handleWorkflowTask​(io.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponseOrBuilder workflowTask,
                                              WorkflowHistoryIterator historyIterator)
                                       throws java.lang.Throwable
        Handles a single new workflow task of the workflow.
        Parameters:
        workflowTask - task to handle
        Returns:
        an object that can be used to build workflow task completion or failure response
        Throws:
        java.lang.Throwable - if processing experienced issues that are considered unrecoverable inside the current workflow task. NonDeterministicException or Error are such cases.
      • handleDirectQueryWorkflowTask

        QueryResult handleDirectQueryWorkflowTask​(io.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponseOrBuilder workflowTask,
                                                  WorkflowHistoryIterator historyIterator)
                                           throws java.lang.Throwable
        Handles a Direct Query (or Legacy Query) scenario. In this case, it's not a real workflow task and the processing can't generate any new commands.
        Parameters:
        workflowTask - task to handle
        Returns:
        an object that can be used to build a legacy query response
        Throws:
        java.lang.Throwable - if processing experienced issues that are considered unrecoverable inside the current workflow task. NonDeterministicException or Error are such cases.
      • close

        void close()