551
timerCancel := NewHistoryEventVertex(enumspb.EVENT_TYPE_TIMER_CANCELED.String())
552
timerCancel.SetDataFunc(func(input ...any) any {
554
>
lastGeneratedEvent := input[1].(*historypb.HistoryEvent)
555
>
eventID := lastGeneratedEvent.GetEventId() + 1
556
>
version := input[2].(int64)
557
>
historyEvent := getDefaultHistoryEvent(eventID, version)
558
>
historyEvent.EventType = enumspb.EVENT_TYPE_TIMER_CANCELED
559
>
historyEvent.Attributes = &historypb.HistoryEvent_TimerCanceledEventAttributes{TimerCanceledEventAttributes: &historypb.TimerCanceledEventAttributes{
560
>
TimerId: lastEvent.GetTimerStartedEventAttributes().TimerId,
561
>
StartedEventId: lastEvent.EventId,
562
>
WorkflowTaskCompletedEventId: lastEvent.GetTimerStartedEventAttributes().WorkflowTaskCompletedEventId,
563
>
Identity: identity,
564
>
}}
565
>
return historyEvent
566
>
})
567
timerStartToFire := NewHistoryEventEdge(timerStart, timerFired)
568
timerStartToCancel := NewHistoryEventEdge(timerStart, timerCancel)