53
archetypeID chasm.ArchetypeID,
54
targetWorkflow Workflow,
56
>
57
>
// NOTE: this function does NOT mutate current workflow or target workflow,
58
>
// workflow mutation is done in methods within executeTransaction function
59
>
60
>
targetExecutionInfo := targetWorkflow.GetMutableState().GetExecutionInfo()
61
>
targetExecutionState := targetWorkflow.GetMutableState().GetExecutionState()
62
>
namespaceID := namespace.ID(targetExecutionInfo.NamespaceId)
63
>
workflowID := targetExecutionInfo.WorkflowId
64
>
targetRunID := targetExecutionState.RunId
65
>
66
>
// we need to check the current workflow execution
67
>
currentRunID, err := r.transactionMgr.GetCurrentWorkflowRunID(
68
>
ctx,
69
>
namespaceID,
70
>
workflowID,
71
>
archetypeID,
72
>
)
73
>
if err != nil {
74
// error out or workflow already created
75
return err
76
}
78
return consts.ErrDuplicate
79
}