Пример #1
0
 /// <summary>
 /// Starts the workflow
 /// </summary>
 /// <param name="input">The inout for the workflow</param>
 /// <returns></returns>
 public async Task StartWorkflowAsync(object input)
 {
     try
     {
         await _amazonSimpleWorkflowClient.StartWorkflowExecutionAsync(new StartWorkflowExecutionRequest
         {
             WorkflowId   = _orchestrationId,
             Domain       = Constants.LAMBDA_BIZ_DOMAIN,
             WorkflowType = new WorkflowType
             {
                 Name    = Constants.LAMBDA_BIZ_WORKFLOW_TYPE,
                 Version = Constants.LAMBDA_BIZ_TYPE_VERSION
             },
             Input    = JsonConvert.SerializeObject(input),
             TaskList = new TaskList
             {
                 Name = Constants.LAMBDA_BIZ_TASK_LIST + _orchestrationId
             },
             ExecutionStartToCloseTimeout = "31536000",
             TaskStartToCloseTimeout      = "NONE",
             ChildPolicy = ChildPolicy.TERMINATE,
             LambdaRole  = _lambdaRole
         });
     }
     catch (WorkflowExecutionAlreadyStartedException)
     {
     }
 }
Пример #2
0
        public void StartWorkflow(string name)
        {
            string workflowID = "WorkflowID - " + DateTime.Now.Ticks.ToString();

            swfClient.StartWorkflowExecutionAsync(new StartWorkflowExecutionRequest()
            {
                Input = "{\"customKey\":\"customvalue\"}",

                WorkflowId   = workflowID,
                Domain       = domainName,
                WorkflowType = new WorkflowType()
                {
                    Name    = name,
                    Version = "1.0"
                }
            });
            Console.WriteLine("Workflow Started:" + workflowID);
        }