protected void RunFlow(object sender, CommandEventArgs e) { var dto = new EmailDto() { Subject = txtEmailTitle.Text, Content = txtEmailContent.Text, From = "", To = txtEmailAddress.Text }; var validator = ServiceLocator.Current.GetInstance<IValidator<EmailDto>>(); var result = validator.Validate(dto); // need to output something there var flowInput = new WorkFlowInput() { Email = dto, IsNewRequest = true }; var workflow = new FlowHost(); workflow.OnWfCompleted += workflow_OnWfCompleted; workflow.OnWfError += workflow_OnWfError; workflow.OnIdle += workflow_OnIdle; var workflowId = workflow.CreateOrResume(flowInput); if (workflowId.HasValue) instanceId.Value = workflowId.Value.ToString(); }
public void ResumeEmailFlow(string bookmarkName, string instanceId) { var workflow = new FlowHost(); workflow.OnWfCompleted += workflow_OnWfCompleted; workflow.OnWfError += workflow_OnWfError; var flowInput = new WorkFlowInput() { Email = null, IsNewRequest = false, BookmarkName = bookmarkName, InstanceId = Guid.Parse(instanceId) }; workflow.CreateOrResume(flowInput); }
public Guid? InitEmailFlow(EmailDto dto) { var flowInput = new WorkFlowInput() { Email = dto, IsNewRequest = true }; var workflow = new FlowHost(); workflow.OnWfCompleted += workflow_OnWfCompleted; workflow.OnWfError += workflow_OnWfError; workflow.OnIdle += workflow_OnIdle; var workflowId = workflow.CreateOrResume(flowInput); return workflowId; }
protected void ResumeFlow(object sender, CommandEventArgs e) { var guidStr = instanceId.Value; var workflow = new FlowHost(); workflow.OnWfCompleted += workflow_OnWfCompleted; workflow.OnWfError += workflow_OnWfError; var flowInput = new WorkFlowInput() { Email = null, IsNewRequest = false, BookmarkName = Constant.Bookmark.WaitforConfirmation, InstanceId = Guid.Parse(guidStr) }; workflow.CreateOrResume(flowInput); }