18
shard historyi.ShardContext,
19
workflowConsistencyChecker api.WorkflowConsistencyChecker,
20
>
) (resp *historyservice.SignalWorkflowExecutionResponse, retError error) {
api.go
21
>
namespaceEntry, err := api.GetActiveNamespace(shard, namespace.ID(req.GetNamespaceId()), req.SignalRequest.WorkflowExecution.WorkflowId)
22
>
if err != nil {
23
return nil, err
24
}
25
>
namespaceID := namespaceEntry.ID()
api.go
26
>
27
>
request := req.SignalRequest
28
>
externalWorkflowExecution := req.ExternalWorkflowExecution
29
>
childWorkflowOnly := req.GetChildWorkflowOnly()
30
>
31
>
// Capture the currently-running workflow's runID from mutableState via our closure,
32
>
// in case the caller didn't pin the signal to a specific runID.
33
>
var runID string
34
>
err = api.GetAndUpdateWorkflowWithNew(
35
>
ctx,
36
>
nil,
37
>
definition.NewWorkflowKey(
38
>
namespaceID.String(),
39
>
request.WorkflowExecution.WorkflowId,
40
>
request.WorkflowExecution.RunId,
41
>
),
42
>
func(workflowLease api.WorkflowLease) (*api.UpdateWorkflowAction, error) {
43
>
mutableState := workflowLease.GetMutableState()
44
>
runID = mutableState.GetExecutionState().GetRunId()
45
>
if request.GetRequestId() != "" && mutableState.IsSignalRequested(request.GetRequestId()) {
46
return &api.UpdateWorkflowAction{
47
Noop: true,