880
externalWorkflowCanceled := NewHistoryEventVertex(enumspb.EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED.String())
881
externalWorkflowCanceled.SetDataFunc(func(input ...any) any {
883
>
lastGeneratedEvent := input[1].(*historypb.HistoryEvent)
884
>
eventID := lastGeneratedEvent.GetEventId() + 1
885
>
version := input[2].(int64)
886
>
historyEvent := getDefaultHistoryEvent(eventID, version)
887
>
historyEvent.EventType = enumspb.EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED
888
>
historyEvent.Attributes = &historypb.HistoryEvent_ExternalWorkflowExecutionCancelRequestedEventAttributes{ExternalWorkflowExecutionCancelRequestedEventAttributes: &historypb.ExternalWorkflowExecutionCancelRequestedEventAttributes{
889
>
InitiatedEventId: lastEvent.EventId,
890
>
Namespace: nsName.String(),
891
>
NamespaceId: nsID.String(),
892
>
WorkflowExecution: &commonpb.WorkflowExecution{
893
>
WorkflowId: lastEvent.GetRequestCancelExternalWorkflowExecutionInitiatedEventAttributes().GetWorkflowExecution().WorkflowId,
894
>
RunId: lastEvent.GetRequestCancelExternalWorkflowExecutionInitiatedEventAttributes().GetWorkflowExecution().RunId,
895
>
},
896
>
}}
897
>
return historyEvent
898
>
})
899
workflowTaskCompleteToExternalWorkflowSignal := NewHistoryEventEdge(workflowTaskComplete, externalWorkflowSignal)
900
workflowTaskCompleteToExternalWorkflowCancel := NewHistoryEventEdge(workflowTaskComplete, externalWorkflowCancel)