コード例 #1
0
ファイル: Index.aspx.cs プロジェクト: kanewanggit/MbTcsClone
        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();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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;
        }
コード例 #4
0
ファイル: Index.aspx.cs プロジェクト: kanewanggit/MbTcsClone
        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);
        }