Exemplo n.º 1
0
        private void serverConfirmButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.processGrid != null)
                {
                    List <WorkflowInfo> processInfoList = new List <WorkflowInfo>();

                    foreach (string key in this.processGrid.SelectedKeys)
                    {
                        IWfProcess process     = WfRuntime.GetProcessByProcessID(key);
                        var        processInfo = WorkflowInfo.ProcessAdapter(process);
                        processInfoList.Add(processInfo);
                    }

                    HtmlInputHidden resultData = (HtmlInputHidden)WebControlUtility.FindControlByID(this, "resultData", true);

                    if (resultData != null)
                    {
                        resultData.Value = JSONSerializerExecute.Serialize(processInfoList);
                    }

                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Close",
                                                            string.Format("window.returnValue = $get('{0}').value; top.close()", resultData.ClientID),
                                                            true);
                }
            }
            catch (System.Exception ex)
            {
                string errorScript = WebUtility.GetShowClientErrorScript(ex.Message, ex.StackTrace, "错误");
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ShowError",
                                                        "SubmitButton.resetAllStates();" + errorScript,
                                                        true);
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
            var desc = LoadProcessDescriptor("cb80a469-82bd-8061-42ce-681f775570ef");

            AddNodeToDescription(desc, 3);
            var node3Desc          = desc.Activities[3].Descriptor;
            WfTransferParams param = new WfTransferParams(node3Desc);

            desc.MoveTo(param);
            var info = WorkflowInfo.ProcessAdapter(desc);

            this.viewer1.InitializeValue = info;

            desc = LoadProcessDescriptor("cb80a469-82bd-8061-42ce-681f775570ef");
            AddNodeToDescription(desc, 5);
            node3Desc = desc.Activities[3].Descriptor;
            param     = new WfTransferParams(node3Desc);
            desc.MoveTo(param);
            info = WorkflowInfo.ProcessAdapter(desc);
            viewer2.InitializeValue = info;
            //this.viewer1.BranchProcessListUrl = "./ModalDialog/WfBranchProcessList.aspx";
        }
 private static WorkflowInfo GetWorkflowInfo(IWfProcess process, bool isMainStream)
 {
     return(WorkflowInfo.ProcessAdapter(process, isMainStream));
 }