2473
// DeleteWorkflowExecution deletes a closed workflow execution asynchronously (workflow must be completed or terminated before).
2474
// This method is EXPERIMENTAL and may be changed or removed in a later release.
2475
>
func (wh *WorkflowHandler) DeleteWorkflowExecution(ctx context.Context, request *workflowservice.DeleteWorkflowExecutionRequest) (_ *workflowservice.DeleteWorkflowExecutionResponse, retError error) {
workflow_handler.go
2476
>
defer log.CapturePanic(wh.logger, &retError)
2477
>
2478
>
if request == nil {
2479
return nil, errRequestNotSet
2480
}
2481
2482
>
if err := validateExecution(request.WorkflowExecution); err != nil {
workflow_handler.go
2483
return nil, err
2484
}
2485
2486
>
namespaceID, err := wh.namespaceRegistry.GetNamespaceID(namespace.Name(request.GetNamespace()))
workflow_handler.go
2487
>
if err != nil {
2488
return nil, err
2489
}
2490
2491
>
_, err = wh.historyClient.DeleteWorkflowExecution(ctx, &historyservice.DeleteWorkflowExecutionRequest{
workflow_handler.go
2492
>
NamespaceId: namespaceID.String(),
2493
>
WorkflowExecution: request.GetWorkflowExecution(),
2494
>
ClosedWorkflowOnly: false,
2495
>
})
2496
>
if err != nil {
2497
>
return nil, err
2498
>
}
2499
2501
}
2502