96
dbRecordVersion int64,
97
branchToken []byte,
98
>
) (*p.WorkflowMutation, []*p.WorkflowEvents) {
util.go
99
>
mutation := &p.WorkflowMutation{
100
>
ExecutionInfo: RandomExecutionInfo(namespaceID, workflowID, eventID, lastWriteVersion, branchToken),
101
>
ExecutionState: RandomExecutionState(runID, state, status, lastWriteVersion),
102
>
103
>
NextEventID: eventID + 1, // NOTE: RandomMutation generates a single history event, hence NextEventID is plus 1
104
>
105
>
UpsertActivityInfos: RandomInt64ActivityInfoMap(),
106
>
DeleteActivityInfos: map[int64]struct{}{rand.Int63(): {}},
107
>
UpsertTimerInfos: RandomStringTimerInfoMap(),
108
>
DeleteTimerInfos: map[string]struct{}{uuid.New().String(): {}},
109
>
UpsertChildExecutionInfos: RandomInt64ChildExecutionInfoMap(),
110
>
DeleteChildExecutionInfos: map[int64]struct{}{rand.Int63(): {}},
111
>
UpsertRequestCancelInfos: RandomInt64RequestCancelInfoMap(),
112
>
DeleteRequestCancelInfos: map[int64]struct{}{rand.Int63(): {}},
113
>
UpsertSignalInfos: RandomInt64SignalInfoMap(),
114
>
DeleteSignalInfos: map[int64]struct{}{rand.Int63(): {}},
115
>
UpsertSignalRequestedIDs: map[string]struct{}{uuid.New().String(): {}},
116
>
DeleteSignalRequestedIDs: map[string]struct{}{uuid.New().String(): {}},
117
>
UpsertChasmNodes: RandomChasmNodeMap(),
118
>
DeleteChasmNodes: map[string]struct{}{uuid.New().String(): {}},
119
>
// NewBufferedEvents: see below
120
>
// ClearBufferedEvents: see below
121
>
122
>
Tasks: map[tasks.Category][]tasks.Task{
123
>
tasks.CategoryTransfer: {},
124
>
tasks.CategoryTimer: {},
125
>
tasks.CategoryReplication: {},
126
>
tasks.CategoryVisibility: {},
127
>
},
128
>
129
>
Condition: rand.Int63(),
130
>
DBRecordVersion: dbRecordVersion,
131
>
}
132
>
133
>
if branchToken == nil {
134
return mutation, nil
135
}