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 Details

    • handleWorkflowTask

      WorkflowTaskResult handleWorkflowTask(io.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponseOrBuilder workflowTask, WorkflowHistoryIterator historyIterator) throws 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:
      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 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:
      Throwable - if processing experienced issues that are considered unrecoverable inside the current workflow task. NonDeterministicException or Error are such cases.
    • resetStartedEventId

      void resetStartedEventId(Long eventId)
      Reset the workflow event ID.
      Parameters:
      eventId - the event ID to reset the cached state to.
    • close

      void close()