Class WorkflowExecutionHistory


  • public final class WorkflowExecutionHistory
    extends WorkflowExecutionHistory
    Provides a wrapper with convenience methods over raw protobuf History object representing workflow history
    • Constructor Summary

      Constructors 
      Constructor Description
      WorkflowExecutionHistory​(io.temporal.api.history.v1.History history)  
      WorkflowExecutionHistory​(io.temporal.api.history.v1.History history, java.lang.String workflowId)
      WorkflowId is not persisted in workflow history, and sometimes it may be important to have it set (workflow replay may rely on it if WorkflowExecutionHistory is used for a history replay)
    • Constructor Detail

      • WorkflowExecutionHistory

        public WorkflowExecutionHistory​(io.temporal.api.history.v1.History history)
        Parameters:
        history - raw history object to enrich
      • WorkflowExecutionHistory

        public WorkflowExecutionHistory​(io.temporal.api.history.v1.History history,
                                        java.lang.String workflowId)
        WorkflowId is not persisted in workflow history, and sometimes it may be important to have it set (workflow replay may rely on it if WorkflowExecutionHistory is used for a history replay)
        Parameters:
        history - raw history object to enrich
        workflowId - workflow id to be used in getWorkflowExecution()
    • Method Detail

      • fromJson

        public static WorkflowExecutionHistory fromJson​(java.lang.String serialized)
        Parameters:
        serialized - history json (tctl format) to import and deserialize into History
        Returns:
        WorkflowExecutionHistory
      • fromJson

        public static WorkflowExecutionHistory fromJson​(java.lang.String serialized,
                                                        java.lang.String workflowId)
        Parameters:
        serialized - history json (tctl format) to import and deserialize into History
        workflowId - workflow id to be used in getWorkflowExecution()
        Returns:
        WorkflowExecutionHistory
      • toJson

        public java.lang.String toJson​(boolean prettyPrint)
        Overrides:
        toJson in class WorkflowExecutionHistory
        Returns:
        full json that can be used for replay and which is compatible with tctl
      • toProtoText

        public java.lang.String toProtoText​(boolean showWorkflowTasks)
        Returns workflow instance history in a human-readable format.
        Overrides:
        toProtoText in class WorkflowExecutionHistory
        Parameters:
        showWorkflowTasks - when set to false workflow task events (command events) are not included