Class WorkflowExecutionUtils
java.lang.Object
io.temporal.internal.common.WorkflowExecutionUtils
Convenience methods to be used by unit tests and during development. Intended to be a collection
of relatively small static utility methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsEvent(List<io.temporal.api.history.v1.HistoryEvent> history, io.temporal.api.enums.v1.EventType eventType) static io.temporal.api.enums.v1.WorkflowExecutionStatusgetCloseStatus(io.temporal.api.history.v1.HistoryEvent event) static io.temporal.api.history.v1.HistoryEventgetEventOfType(io.temporal.api.history.v1.History history, io.temporal.api.enums.v1.EventType eventType) static List<io.temporal.api.history.v1.HistoryEvent> getEventsOfType(io.temporal.api.history.v1.History history, io.temporal.api.enums.v1.EventType eventType) static io.temporal.api.enums.v1.EventTypegetEventTypeForCommand(io.temporal.api.enums.v1.CommandType commandType) Returns event that corresponds to a command.static StringgetFailureCause(io.temporal.api.history.v1.HistoryEvent historyEvent) static StringgetId(io.temporal.api.history.v1.HistoryEvent historyEvent) 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) static io.temporal.api.common.v1.WorkflowExecutiongetWorkflowIdFromExternalWorkflowCompletedEvent(io.temporal.api.history.v1.HistoryEvent event) static booleanisActivityTaskClosedEvent(io.temporal.api.history.v1.HistoryEvent event) static booleanisCommandEvent(io.temporal.api.history.v1.HistoryEvent event) Command event is an event that is created to mirror a command issued by a workflow taskstatic booleanisExternalWorkflowClosedEvent(io.temporal.api.history.v1.HistoryEvent event) static booleanisFullHistory(io.temporal.api.workflowservice.v1.PollWorkflowTaskQueueResponseOrBuilder workflowTask) static booleanisWorkflowExecutionClosedEvent(io.temporal.api.history.v1.HistoryEventOrBuilder event) static booleanisWorkflowExecutionCompleteCommand(io.temporal.api.command.v1.Command command) static booleanisWorkflowTaskClosedEvent(io.temporal.api.history.v1.HistoryEventOrBuilder event) static io.temporal.api.sdk.v1.UserMetadatamakeUserMetaData(String summary, String details, DataConverter dc) static StringprettyPrintCommands(Iterable<io.temporal.api.command.v1.Command> commands) static StringprettyPrintObject(com.google.protobuf.MessageOrBuilder object) Pretty prints a proto message.
-
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
-
getFailureCause
-
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
-
prettyPrintObject
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)
-