41
persistenceVisibilityMgr manager.VisibilityManager,
42
workflowConsistencyChecker api.WorkflowConsistencyChecker,
43
>
) (*historyservice.RecordWorkflowTaskStartedResponseWithRawHistory, error) {
api.go
44
>
namespaceEntry, err := api.GetActiveNamespace(shardContext, namespace.ID(req.GetNamespaceId()), req.WorkflowExecution.WorkflowId)
45
>
if err != nil {
46
return nil, err
47
}
48
49
>
scheduledEventID := req.GetScheduledEventId()
api.go
50
>
requestID := req.GetRequestId()
51
>
52
>
var workflowKey definition.WorkflowKey
53
>
var resp *historyservice.RecordWorkflowTaskStartedResponseWithRawHistory
54
>
55
>
err = api.GetAndUpdateWorkflowWithNew(
56
>
ctx,
57
>
req.Clock,
58
>
definition.NewWorkflowKey(
59
>
req.NamespaceId,
60
>
req.WorkflowExecution.WorkflowId,
61
>
req.WorkflowExecution.RunId,
62
>
),
63
>
func(workflowLease api.WorkflowLease) (res *api.UpdateWorkflowAction, retErr error) {
64
mutableState := workflowLease.GetMutableState()
65
if !mutableState.IsWorkflowExecutionRunning() {