571
var updatedStateMachines []*persistencespb.WorkflowMutableStateMutation_StateMachineNodeMutation
572
walkFn := func(node *hsm.Node) error {
574
return serviceerror.NewInvalidArgument("Nil node is not expected")
575
}
577
>
return nil
578
>
}
579
>
convertKey := func(ori []hsm.Key) *persistencespb.StateMachinePath {
580
>
var path []*persistencespb.StateMachineKey
581
>
for _, k := range ori {
582
>
path = append(path, &persistencespb.StateMachineKey{
583
>
Type: k.Type,
584
>
Id: k.ID,
585
>
})
586
>
}
587
>
return &persistencespb.StateMachinePath{
588
>
Path: path,
589
>
}
590
}
592
>
subStateMachine := node.InternalRepr()
593
>
workflow.SanitizeStateMachineNode(subStateMachine)
594
>
updatedStateMachines = append(updatedStateMachines, &persistencespb.WorkflowMutableStateMutation_StateMachineNodeMutation{
595
>
Path: convertKey(node.Path()),
596
>
Data: subStateMachine.Data,
597
>
InitialVersionedTransition: subStateMachine.InitialVersionedTransition,
598
>
LastUpdateVersionedTransition: subStateMachine.LastUpdateVersionedTransition,
599
>
})
600
>
}
601
>
return nil
602
}
603
// Source cluster uses Walk() to generate node mutations.