public void ok_Click(object sender, AjaxEventArgs e)
        {
            WorkflowDefinition wd = new WorkflowDefinition();
            //如是修改。
            string id = this.HProcessId.Value.ToString().Trim();

            if (!string.IsNullOrEmpty(id))
            {
                wd = RuntimeContextExamples.GetRuntimeContext().PersistenceService.FindWorkflowDefinitionById(id);
            }
            else
            {
                wd.PublishTime = DateTime.Now;
                wd.PublishUser = "******";
            }
            wd.UploadTime = DateTime.Now;
            wd.UploadUser = "******";
            wd.State      = Boolean.Parse(this.state.SelectedItem.Value);

            if (this.BasicField.HasFile)
            {
                //string filename = this.Server.MapPath("~/WorkFlowTemp/" + BasicField.PostedFile.FileName);
                //BasicField.PostedFile.SaveAs(filename);

                WorkflowProcess workflowProcess;
                using (Stream inStream = BasicField.PostedFile.InputStream)//new FileStream(filename, FileMode.Open))
                {
                    if (inStream == null)
                    {
                        throw new IOException("没有上传流程定义文件!");
                    }
                    Dom4JFPDLParser parser = new Dom4JFPDLParser();
                    workflowProcess = parser.parse(inStream);
                }
                if (workflowProcess != null)
                {
                    if (string.IsNullOrEmpty(id))
                    {
                        wd.ProcessId = workflowProcess.Id;
                    }
                    wd.Name        = workflowProcess.Name;
                    wd.DisplayName = workflowProcess.DisplayName;
                    wd.Description = workflowProcess.Description;
                    wd.setWorkflowProcess(workflowProcess);
                    //wd.ProcessContent = File.ReadAllText(filename);// twd.ProcessContent;
                }
                else
                {
                    Ext.Msg.Show(new MessageBox.Config
                    {
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Title   = "Success",
                        Message = "错误的流程文件。"
                    });
                    return;
                }
            }

            if (RuntimeContextExamples.GetRuntimeContext().PersistenceService.SaveOrUpdateWorkflowDefinition(wd))
            {
                WorkflowEdit.Hide();

                Ext.Msg.Show(new MessageBox.Config
                {
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Title   = "Success",
                    Message = "保存成功。"
                });

                query_Click(null, null);
            }
            else
            {
                Ext.Msg.Show(new MessageBox.Config
                {
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Title   = "Success",
                    Message = "保存出错。"
                });
            }
        }