public static WorkflowItemEvent CreateTimerEventFor(this HistoryEvent historyEvent, IEnumerable <HistoryEvent> allHistoryEvents) { if (historyEvent.IsTimerFiredEvent()) { return(new TimerFiredEvent(historyEvent, allHistoryEvents)); } if (historyEvent.IsTimerStartedEvent()) { return(new TimerStartedEvent(historyEvent, allHistoryEvents)); } if (historyEvent.IsTimerStartFailedEvent()) { return(new TimerStartFailedEvent(historyEvent)); } if (historyEvent.IsTimerCancelledEvent()) { return(new TimerCancelledEvent(historyEvent, allHistoryEvents)); } if (historyEvent.IsTimerCancellationFailedEvent()) { return(new TimerCancellationFailedEvent(historyEvent)); } return(null); }
public static WorkflowEvent CreateInterpretableEvent(this HistoryEvent historyEvent, IEnumerable <HistoryEvent> allHistoryEvents) { if (historyEvent.IsActivityCompletedEvent()) { return(new ActivityCompletedEvent(historyEvent, allHistoryEvents)); } if (historyEvent.IsActivityFailedEvent()) { return(new ActivityFailedEvent(historyEvent, allHistoryEvents)); } if (historyEvent.IsActivityTimedoutEvent()) { return(new ActivityTimedoutEvent(historyEvent, allHistoryEvents)); } if (historyEvent.IsActivityCancelledEvent()) { return(new ActivityCancelledEvent(historyEvent, allHistoryEvents)); } if (historyEvent.IsActivityCancellationFailedEvent()) { return(new ActivityCancellationFailedEvent(historyEvent)); } if (historyEvent.IsWorkflowStartedEvent()) { return(new WorkflowStartedEvent(historyEvent)); } if (historyEvent.IsTimerFiredEvent()) { return(new TimerFiredEvent(historyEvent, allHistoryEvents)); } if (historyEvent.IsTimerFailedEvent()) { return(new TimerStartFailedEvent(historyEvent)); } if (historyEvent.IsTimerCancelledEvent()) { return(new TimerCancelledEvent(historyEvent, allHistoryEvents)); } if (historyEvent.IsTimerCancellationFailedEvent()) { return(new TimerCancellationFailedEvent(historyEvent)); } if (historyEvent.IsWorkflowSignaledEvent()) { return(new WorkflowSignaledEvent(historyEvent)); } if (historyEvent.IsWorkflowCancellationRequestedEvent()) { return(new WorkflowCancellationRequestedEvent(historyEvent)); } if (historyEvent.IsWorkflowCompletionFailedEvent()) { return(new WorkflowCompletionFailedEvent(historyEvent)); } if (historyEvent.IsWorkflowFailureFailedEvent()) { return(new WorkflowFailureFailedEvent(historyEvent)); } if (historyEvent.IsWorkflowSignalFailedEvent()) { return(new WorkflowSignalFailedEvent(historyEvent)); } if (historyEvent.IsWorkflowCancelRequestFailedEvent()) { return(new WorkflowCancelRequestFailedEvent(historyEvent)); } if (historyEvent.IsWorkflowCancellationFailedEvent()) { return(new WorkflowCancellationFailedEvent(historyEvent)); } return(null); }