859
externalWorkflowCancelFail := NewHistoryEventVertex(enumspb.EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED.String())
860
externalWorkflowCancelFail.SetDataFunc(func(input ...any) any {
862
>
lastGeneratedEvent := input[1].(*historypb.HistoryEvent)
863
>
eventID := lastGeneratedEvent.GetEventId() + 1
864
>
version := input[2].(int64)
865
>
historyEvent := getDefaultHistoryEvent(eventID, version)
866
>
historyEvent.EventType = enumspb.EVENT_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED
867
>
historyEvent.Attributes = &historypb.HistoryEvent_RequestCancelExternalWorkflowExecutionFailedEventAttributes{RequestCancelExternalWorkflowExecutionFailedEventAttributes: &historypb.RequestCancelExternalWorkflowExecutionFailedEventAttributes{
868
>
Cause: enumspb.CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_EXTERNAL_WORKFLOW_EXECUTION_NOT_FOUND,
869
>
WorkflowTaskCompletedEventId: lastEvent.GetRequestCancelExternalWorkflowExecutionInitiatedEventAttributes().WorkflowTaskCompletedEventId,
870
>
Namespace: nsName.String(),
871
>
NamespaceId: nsID.String(),
872
>
WorkflowExecution: &commonpb.WorkflowExecution{
873
>
WorkflowId: lastEvent.GetRequestCancelExternalWorkflowExecutionInitiatedEventAttributes().GetWorkflowExecution().WorkflowId,
874
>
RunId: lastEvent.GetRequestCancelExternalWorkflowExecutionInitiatedEventAttributes().GetWorkflowExecution().RunId,
875
>
},
876
>
InitiatedEventId: lastEvent.EventId,
877
>
}}
878
>
return historyEvent
879
>
})
880
externalWorkflowCanceled := NewHistoryEventVertex(enumspb.EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED.String())
881
externalWorkflowCanceled.SetDataFunc(func(input ...any) any {