/// <summary> /// Create orchestartion /// </summary> /// <param name="orchestrationId">Unique id to identify the orchestration</param> /// <returns></returns> public async Task <IOrchestration> CreateOrchestrationAsync(string orchestrationId) { try { await _amazonSimpleWorkflowClient.RegisterDomainAsync(new RegisterDomainRequest { Name = Constants.LAMBDA_BIZ_DOMAIN, WorkflowExecutionRetentionPeriodInDays = "90" }); } catch (DomainAlreadyExistsException) { } try { await _amazonSimpleWorkflowClient.RegisterWorkflowTypeAsync(new RegisterWorkflowTypeRequest { Domain = Constants.LAMBDA_BIZ_DOMAIN, Name = Constants.LAMBDA_BIZ_WORKFLOW_TYPE, Version = Constants.LAMBDA_BIZ_TYPE_VERSION }); } catch (TypeAlreadyExistsException) { } try { await _amazonSimpleWorkflowClient.RegisterActivityTypeAsync(new RegisterActivityTypeRequest { Domain = Constants.LAMBDA_BIZ_DOMAIN, Name = Constants.LAMBDA_BIZ_ACTIVITY_TYPE, Version = Constants.LAMBDA_BIZ_TYPE_VERSION }); } catch (TypeAlreadyExistsException) { } return(new AWSOrchestration(_amazonSimpleWorkflowClient, orchestrationId, _store, _lambdaRole)); }
public void RegisterMyDomain() { var request = new ListDomainsRequest(); request.RegistrationStatus = RegistrationStatus.REGISTERED; var results = swfClient.ListDomainsAsync(request).Result; if (results.DomainInfos.Infos.FirstOrDefault(x => x.Name == domainName) == null) { RegisterDomainRequest registerRequest = new RegisterDomainRequest() { Name = domainName, Description = "Custom Description Here", WorkflowExecutionRetentionPeriodInDays = "1" }; swfClient.RegisterDomainAsync(registerRequest); Console.WriteLine("Domain Created: " + domainName); } }