@@ -69,6 +69,7 @@ func newMutableStateBuilder(logger bark.Logger) *mutableStateBuilder {
69
69
s .executionInfo = & persistence.WorkflowExecutionInfo {
70
70
NextEventID : firstEventID ,
71
71
State : persistence .WorkflowStateCreated ,
72
+ CloseStatus : persistence .WorkflowCloseStatusNone ,
72
73
LastProcessedEvent : emptyEventID ,
73
74
}
74
75
@@ -330,6 +331,7 @@ func (e *mutableStateBuilder) AddWorkflowExecutionStartedEvent(domainID string,
330
331
e .executionInfo .DecisionTimeoutValue = request .GetTaskStartToCloseTimeoutSeconds ()
331
332
332
333
e .executionInfo .State = persistence .WorkflowStateCreated
334
+ e .executionInfo .CloseStatus = persistence .WorkflowCloseStatusNone
333
335
e .executionInfo .LastProcessedEvent = emptyEventID
334
336
e .executionInfo .CreateRequestID = request .GetRequestId ()
335
337
e .executionInfo .DecisionScheduleID = emptyEventID
@@ -591,6 +593,7 @@ func (e *mutableStateBuilder) AddCompletedWorkflowEvent(decisionCompletedEventID
591
593
}
592
594
593
595
e .executionInfo .State = persistence .WorkflowStateCompleted
596
+ e .executionInfo .CloseStatus = persistence .WorkflowCloseStatusCompleted
594
597
return e .hBuilder .AddCompletedWorkflowEvent (decisionCompletedEventID , attributes )
595
598
}
596
599
@@ -602,6 +605,7 @@ func (e *mutableStateBuilder) AddFailWorkflowEvent(decisionCompletedEventID int6
602
605
}
603
606
604
607
e .executionInfo .State = persistence .WorkflowStateCompleted
608
+ e .executionInfo .CloseStatus = persistence .WorkflowCloseStatusFailed
605
609
return e .hBuilder .AddFailWorkflowEvent (decisionCompletedEventID , attributes )
606
610
}
607
611
@@ -628,6 +632,7 @@ func (e *mutableStateBuilder) AddWorkflowExecutionCanceledEvent(decisionTaskComp
628
632
}
629
633
630
634
e .executionInfo .State = persistence .WorkflowStateCompleted
635
+ e .executionInfo .CloseStatus = persistence .WorkflowCloseStatusCanceled
631
636
return e .hBuilder .AddWorkflowExecutionCanceledEvent (decisionTaskCompletedEventID , attributes )
632
637
}
633
638
@@ -735,6 +740,7 @@ func (e *mutableStateBuilder) AddWorkflowExecutionTerminatedEvent(
735
740
}
736
741
737
742
e .executionInfo .State = persistence .WorkflowStateCompleted
743
+ e .executionInfo .CloseStatus = persistence .WorkflowCloseStatusTerminated
738
744
return e .hBuilder .AddWorkflowExecutionTerminatedEvent (request )
739
745
}
740
746
@@ -759,6 +765,7 @@ func (e *mutableStateBuilder) AddContinueAsNewEvent(decisionCompletedEventID int
759
765
}
760
766
761
767
e .executionInfo .State = persistence .WorkflowStateCompleted
768
+ e .executionInfo .CloseStatus = persistence .WorkflowCloseStatusContinuedAsNew
762
769
newExecution := workflow.WorkflowExecution {
763
770
WorkflowId : common .StringPtr (e .executionInfo .WorkflowID ),
764
771
RunId : common .StringPtr (newRunID ),
0 commit comments