166
167
switch mode {
169
>
// update current record
170
>
// 1. reset workflow only ->
171
>
// reset workflow cannot be zombie
172
>
// 2. reset workflow & new workflow ->
173
>
// reset workflow cannot be created / running / zombie,
174
>
// new workflow cannot be zombie
175
>
// 3. current workflow & reset workflow ->
176
>
// current workflow cannot be created / running,
177
>
// reset workflow cannot be zombie
178
>
// 4. current workflow & reset workflow & new workflow ->
179
>
// current workflow cannot be created / running,
180
>
// reset workflow cannot be created / running / zombie,
181
>
// new workflow cannot be zombie
182
>
183
>
// TODO remove case 1 & 2 support once 2DC is deprecated
184
>
// it is ok that currentWorkflowMutation is null, only for 2 DC case
185
>
// NDC should always require current workflow for CAS
186
>
// Note: current workflow mutation can be in zombie state, for the update
187
>
188
>
// case 1 & 2
189
>
if currentWorkflowState == nil {
190
// case 1
191
if newWorkflowState == nil {