789
newExecution *commonpb.WorkflowExecution,
790
newRunHistory []*historypb.HistoryEvent,
792
>
793
>
// TODO: replication task should contain enough information to determine whether the new run is part of the same chain
794
>
// and not relying on a specific event type to make that decision
795
>
sameWorkflowChain := false
796
>
newRunFirstEvent := newRunHistory[0]
797
>
if newRunFirstEvent.GetEventType() == enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED {
798
>
newRunFirstRunID := newRunFirstEvent.GetWorkflowExecutionStartedEventAttributes().FirstExecutionRunId
799
>
sameWorkflowChain = newRunFirstRunID == b.mutableState.GetExecutionInfo().FirstExecutionRunId
800
>
}
801
803
>
var newRunMutableState historyi.MutableState
804
>
if sameWorkflowChain {
805
newRunMutableState, err = NewMutableStateInChain(
806
b.shard,