83
mutableState historyi.MutableState,
84
task replicationTask,
86
>
branchMgr := m.newBranchMgr(wfContext, mutableState, task.getLogger())
87
>
incomingVersionHistory := task.getVersionHistory()
88
>
eventBatches := task.getEvents()
89
>
eventBatchApplyIndex := 0
90
>
doContinue := false
91
>
var versionHistoryIndex int32
92
>
var err error
93
>
for index, eventBatch := range eventBatches {
94
>
doContinueCurrentBatch, versionHistoryIndexCurrentBatch, errCurrentBatch := branchMgr.GetOrCreate(
95
>
ctx,
96
>
incomingVersionHistory,
97
>
eventBatch[0].GetEventId(),
98
>
eventBatch[0].GetVersion(),
99
>
)
100
>
if doContinueCurrentBatch || errCurrentBatch != nil {
101
eventBatchApplyIndex = index
102
doContinue = doContinueCurrentBatch