static void RegisterWorkflow(string name) { // Register workflow type if not already registered var listWorkflowRequest = new ListWorkflowTypesRequest() { Name = name, Domain = domainName, RegistrationStatus = RegistrationStatus.REGISTERED }; if (swfClient.ListWorkflowTypes(listWorkflowRequest).WorkflowTypeInfos.TypeInfos.FirstOrDefault( x => x.WorkflowType.Version == "2.0") == null) { RegisterWorkflowTypeRequest request = new RegisterWorkflowTypeRequest() { DefaultChildPolicy = ChildPolicy.TERMINATE, DefaultExecutionStartToCloseTimeout = "300", DefaultTaskList = new TaskList() { Name = "HelloWorld" // Decider need to poll for this task }, DefaultTaskStartToCloseTimeout = "150", Domain = domainName, Name = name, Version = "2.0" }; swfClient.RegisterWorkflowType(request); Console.WriteLine("Setup: Registerd Workflow Name - " + request.Name); } }
static void RegisterWorkflow(string name) { // Register workflow type if not already registered var listWorkflowRequest = new ListWorkflowTypesRequest() { Name = name, Domain = domainName, RegistrationStatus = RegistrationStatus.REGISTERED }; if (SwfClient.ListWorkflowTypes(listWorkflowRequest) .WorkflowTypeInfos .TypeInfos .FirstOrDefault(x => x.WorkflowType.Version == "2.0") == null) { var request = new RegisterWorkflowTypeRequest() { DefaultChildPolicy = ChildPolicy.TERMINATE, DefaultExecutionStartToCloseTimeout = "300", DefaultTaskList = new TaskList() { Name = "SwfDemo" // Decider need to poll for this task }, DefaultTaskStartToCloseTimeout = "150", Domain = domainName, Name = name, Version = "2.0" }; try { } catch (TypeAlreadyExistsException tex) { SwfClient.RegisterWorkflowType(request); } Console.WriteLine($"INITIATOR: Registerd Workflow Name - {request.Name}"); } }
private Amazon.SimpleWorkflow.Model.RegisterWorkflowTypeResponse CallAWSServiceOperation(IAmazonSimpleWorkflow client, Amazon.SimpleWorkflow.Model.RegisterWorkflowTypeRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Simple Workflow Service (SWF)", "RegisterWorkflowType"); try { #if DESKTOP return(client.RegisterWorkflowType(request)); #elif CORECLR return(client.RegisterWorkflowTypeAsync(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; } }