Class WorkflowExecutionHistory


  • public final class WorkflowExecutionHistory
    extends WorkflowExecutionHistory
    Provides a wrapper with convenience methods over raw protobuf History object representing workflow history
    • 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
        Parameters:
        prettyPrint - Whether to pretty print the JSON.
        Returns:
        Full json that can be used for replay.
      • 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