140
func (r *WorkflowImpl) SuppressBy(
141
incomingWorkflow Workflow,
142
>
) (historyi.TransactionPolicy, error) {
workflow.go
143
>
144
>
// NOTE: READ BEFORE MODIFICATION
145
>
//
146
>
// if the workflow to be suppressed has last write version being local active
147
>
// then use active logic to terminate this workflow
148
>
// if the workflow to be suppressed has last write version being remote active
149
>
// then turn this workflow into a zombie
150
>
151
>
lastWriteVersion, lastRunningClock, err := r.GetVectorClock()
152
>
if err != nil {
153
return historyi.TransactionPolicyActive, err
154
}
155
>
incomingLastWriteVersion, incomingLastRunningClock, err := incomingWorkflow.GetVectorClock()
workflow.go
156
>
if err != nil {
157
return historyi.TransactionPolicyActive, err
158
}
159
161
>
lastWriteVersion,
162
>
lastRunningClock,
163
>
incomingLastWriteVersion,
164
>
incomingLastRunningClock,
165
>
) {
166
return historyi.TransactionPolicyActive, serviceerror.NewInternal("Workflow cannot suppress workflow by older workflow")
167
}