private Amazon.SimpleWorkflow.Model.RequestCancelWorkflowExecutionResponse CallAWSServiceOperation(IAmazonSimpleWorkflow client, Amazon.SimpleWorkflow.Model.RequestCancelWorkflowExecutionRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Simple Workflow Service (SWF)", "RequestCancelWorkflowExecution"); try { #if DESKTOP return(client.RequestCancelWorkflowExecution(request)); #elif CORECLR return(client.RequestCancelWorkflowExecutionAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
/// <summary> /// Issue a cancellation request to running workflow. /// </summary> /// <param name="cancelRequest"></param> /// <returns></returns> public async Task CancelWorkflowAsync(CancelWorkflowRequest cancelRequest) { Ensure.NotNull(cancelRequest, nameof(cancelRequest)); await _simpleWorkflowClient.RequestCancelWorkflowExecutionAsync(cancelRequest.SwfFormat(_name)); }