Class WorkflowExecutionUtils

java.lang.Object
io.temporal.internal.common.WorkflowExecutionUtils

public class WorkflowExecutionUtils extends Object
Convenience methods to be used by unit tests and during development. Intended to be a collection of relatively small static utility methods.
  • Constructor Details

    • WorkflowExecutionUtils

      public WorkflowExecutionUtils()
  • Method Details

    • getResultFromCloseEvent

      public static Optional<io.temporal.api.common.v1.Payloads> getResultFromCloseEvent(io.temporal.api.common.v1.WorkflowExecution workflowExecution, Optional<String> workflowType, io.temporal.api.history.v1.HistoryEvent closeEvent, DataConverter dataConverter)
    • isWorkflowTaskClosedEvent

      public static boolean isWorkflowTaskClosedEvent(io.temporal.api.history.v1.HistoryEventOrBuilder event)
    • isWorkflowExecutionClosedEvent

      public static boolean isWorkflowExecutionClosedEvent(io.temporal.api.history.v1.HistoryEventOrBuilder event)
    • isWorkflowExecutionCompleteCommand

      public static boolean isWorkflowExecutionCompleteCommand(io.temporal.api.command.v1.Command command)
    • isActivityTaskClosedEvent

      public static boolean isActivityTaskClosedEvent(io.temporal.api.history.v1.HistoryEvent event)
    • isExternalWorkflowClosedEvent

      public static boolean isExternalWorkflowClosedEvent(io.temporal.api.history.v1.HistoryEvent event)
    • getWorkflowIdFromExternalWorkflowCompletedEvent

      public static io.temporal.api.common.v1.WorkflowExecution getWorkflowIdFromExternalWorkflowCompletedEvent(io.temporal.api.history.v1.HistoryEvent event)
    • getId

      public static String getId(io.temporal.api.history.v1.HistoryEvent historyEvent)
    • getFailureCause

      public static String getFailureCause(io.temporal.api.history.v1.HistoryEvent historyEvent)
    • getCloseStatus

      public static io.temporal.api.enums.v1.WorkflowExecutionStatus getCloseStatus(io.temporal.api.history.v1.HistoryEvent event)
    • makeUserMetaData

      public static io.temporal.api.sdk.v1.UserMetadata makeUserMetaData(String summary, String details, DataConverter dc)
    • prettyPrintCommands

      public static String prettyPrintCommands(Iterable<io.temporal.api.command.v1.Command> commands)
    • prettyPrintObject

      public static String prettyPrintObject(com.google.protobuf.MessageOrBuilder object)
      Pretty prints a proto message.
    • containsEvent

      public static boolean containsEvent(List<io.temporal.api.history.v1.HistoryEvent> history, io.temporal.api.enums.v1.EventType eventType)
    • isCommandEvent

      public static boolean isCommandEvent(io.temporal.api.history.v1.HistoryEvent event)
      Command event is an event that is created to mirror a command issued by a workflow task
    • getEventTypeForCommand

      public static io.temporal.api.enums.v1.EventType getEventTypeForCommand(io.temporal.api.enums.v1.CommandType commandType)
      Returns event that corresponds to a command.
    • isFullHistory

      public static boolean isFullHistory(io.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponseOrBuilder workflowTask)
    • getEventOfType

      @Nullable public static io.temporal.api.history.v1.HistoryEvent getEventOfType(io.temporal.api.history.v1.History history, io.temporal.api.enums.v1.EventType eventType)
    • getEventsOfType

      public static List<io.temporal.api.history.v1.HistoryEvent> getEventsOfType(io.temporal.api.history.v1.History history, io.temporal.api.enums.v1.EventType eventType)