79
}
80
82
>
targetExecutionState := mutableState.GetExecutionState()
83
>
namespaceID := namespace.ID(targetExecutionInfo.NamespaceId)
84
>
workflowID := targetExecutionInfo.WorkflowId
85
>
targetRunID := targetExecutionState.RunId
86
>
87
>
// the target workflow is rebuilt
88
>
// we need to check the current workflow execution
89
>
currentRunID, err := r.transactionMgr.GetCurrentWorkflowRunID(
90
>
ctx,
91
>
namespaceID,
92
>
workflowID,
93
>
archetypeID,
94
>
)
95
>
if err != nil {
96
return err
97
}
99
// currentRunID == "" means the current execution record is gone — the current run was
100
// deleted, leaving this closed run an orphan. With no new run to create, persist it via the