Class WorkflowExecutionHistory
java.lang.Object
io.temporal.internal.common.WorkflowExecutionHistory
io.temporal.common.WorkflowExecutionHistory
Provides a wrapper with convenience methods over raw protobuf
History object representing
workflow history-
Field Summary
Fields inherited from class io.temporal.internal.common.WorkflowExecutionHistory
DEFAULT_WORKFLOW_ID -
Constructor Summary
ConstructorsConstructorDescriptionWorkflowExecutionHistory(io.temporal.api.history.v1.History history) WorkflowExecutionHistory(io.temporal.api.history.v1.History history, 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) -
Method Summary
Modifier and TypeMethodDescriptionstatic WorkflowExecutionHistorystatic WorkflowExecutionHistoryList<io.temporal.api.history.v1.HistoryEvent> io.temporal.api.history.v1.Historyio.temporal.api.history.v1.HistoryEventio.temporal.api.common.v1.WorkflowExecutiontoJson(boolean prettyPrint) toProtoText(boolean showWorkflowTasks) Returns workflow instance history in a human-readable format.toString()Methods inherited from class io.temporal.internal.common.WorkflowExecutionHistory
extractWorkflowId, toJson
-
Constructor Details
-
WorkflowExecutionHistory
public WorkflowExecutionHistory(io.temporal.api.history.v1.History history) - Parameters:
history- raw history object to enrich
-
WorkflowExecutionHistory
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 enrichworkflowId- workflow id to be used ingetWorkflowExecution()
-
-
Method Details
-
fromJson
- Parameters:
serialized- history json (temporal CLI format) to import and deserialize intoHistory- Returns:
- WorkflowExecutionHistory
-
fromJson
- Parameters:
serialized- history json (temporal CLI format) to import and deserialize intoHistoryworkflowId- workflow id to be used ingetWorkflowExecution()- Returns:
- WorkflowExecutionHistory
-
toJson
- Overrides:
toJsonin classWorkflowExecutionHistory- Parameters:
prettyPrint- Whether to pretty print the JSON.- Returns:
- Full json that can be used for replay.
-
toProtoText
Returns workflow instance history in a human-readable format.- Overrides:
toProtoTextin classWorkflowExecutionHistory- Parameters:
showWorkflowTasks- when set to false workflow task events (command events) are not included
-
getWorkflowExecution
public io.temporal.api.common.v1.WorkflowExecution getWorkflowExecution()- Overrides:
getWorkflowExecutionin classWorkflowExecutionHistory
-
getEvents
- Overrides:
getEventsin classWorkflowExecutionHistory
-
getLastEvent
public io.temporal.api.history.v1.HistoryEvent getLastEvent()- Overrides:
getLastEventin classWorkflowExecutionHistory
-
getHistory
public io.temporal.api.history.v1.History getHistory()- Overrides:
getHistoryin classWorkflowExecutionHistory
-
toString
- Overrides:
toStringin classWorkflowExecutionHistory
-