632
func (r *TaskGeneratorImpl) GenerateRequestCancelExternalTasks(
633
event *historypb.HistoryEvent,
635
>
636
>
attr := event.GetRequestCancelExternalWorkflowExecutionInitiatedEventAttributes()
637
>
scheduledEventID := event.GetEventId()
638
>
version := event.GetVersion()
639
>
targetWorkflowID := attr.GetWorkflowExecution().GetWorkflowId()
640
>
targetRunID := attr.GetWorkflowExecution().GetRunId()
641
>
targetChildOnly := attr.GetChildWorkflowOnly()
642
>
643
>
_, ok := r.mutableState.GetRequestCancelInfo(scheduledEventID)
644
>
if !ok {
645
return serviceerror.NewInternalf("it could be a bug, cannot get pending request cancel external workflow: %v", scheduledEventID)
646
}
647
648
>
targetNamespaceID, err := r.getTargetNamespaceID(namespace.Name(attr.GetNamespace()), namespace.ID(attr.GetNamespaceId()))
task_generator.go
649
>
if err != nil {
650
return err
651
}
652
654
>
// TaskID, VisibilityTimestamp is set by shard
655
>
WorkflowKey: r.mutableState.GetWorkflowKey(),
656
>
TargetNamespaceID: targetNamespaceID.String(),
657
>
TargetWorkflowID: targetWorkflowID,
658
>
TargetRunID: targetRunID,
659
>
TargetChildWorkflowOnly: targetChildOnly,
660
>
InitiatedEventID: scheduledEventID,
661
>
Version: version,
662
>
})
663
>
664
>
return nil
665
}
666