惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
L
LangChain Blog
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
T
Tailwind CSS Blog
月光博客
月光博客
C
CERT Recently Published Vulnerability Notes
Security Latest
Security Latest
MongoDB | Blog
MongoDB | Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Tenable Blog
博客园_首页
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
InfoQ
The Last Watchdog
The Last Watchdog
宝玉的分享
宝玉的分享
S
Security Affairs
阮一峰的网络日志
阮一峰的网络日志
E
Exploit-DB.com RSS Feed
V
Vulnerabilities – Threatpost
V
Visual Studio Blog
WordPress大学
WordPress大学
W
WeLiveSecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Threatpost
Scott Helme
Scott Helme
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
SecWiki News
SecWiki News
The GitHub Blog
The GitHub Blog
The Register - Security
The Register - Security
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
PCI Perspectives
PCI Perspectives
Last Week in AI
Last Week in AI
Webroot Blog
Webroot Blog
L
LINUX DO - 热门话题
H
Hacker News: Front Page
Blog — PlanetScale
Blog — PlanetScale
T
The Exploit Database - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Privacy International News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
A
Arctic Wolf
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LINUX DO - 最新话题

博客园 - 软件之美,美在缺陷-Johnson

轻松部署Captaris Workflow 6.5模型 浅比.NET和Java开发工具。 .NET资源转换工具 排除大型工作流应用的性能问题纪要。 淘宝网一家店里看到的留言和掌柜的搞笑回复。 Windows Network Load Balancing群集故障排除手记。 Captaris Workflow 6.0 EventService 执行效率低下的排除。 Captaris Workflow开发系列课程介绍。 在虚拟机里System进程占用CPU100%的问题解决 如何做好售前技术支持工作 一家公司网站上的招聘人才招聘栏目 在GridView中使用ModalPopupExtender(转) VMWare 5.5 虚拟机错误。 Your've got mail A new post form Microsoft Live Writer. How to: Debug Captaris Workflow 6.0 Process efficiency? How to: Debug Captaris Workflow 6.0 Process efficiency? Captaris Workflow 6.0问题两则。 Recently learning about AJAX on ASP.NET
如何:在OpenText Workflow 6.5模型中保存和读取多行数据
软件之美,美在缺陷-Johnson · 2009-11-17 · via 博客园 - 软件之美,美在缺陷-Johnson

在Captaris Workflow 6.0和之前的版本中,保存多行数据似乎没有被提及,因此大部分(包括我的团队)都要自己建立(利用IDE的向导也算)数据库来保存订单项、物品列表、人员列表这样的多行集合。这一切在6.5都已解决,流程开发者可以保存多行的事省下些脑细胞。不过从应用的情况来看,还是要费一些脑细胞的。下面用示例展示如何保存。

1.在设计流程时加入一个XML对象。

2.新增一行数据:

Teamplate.BLL.IModelXML oXml = this.Process.GetXmlObject("Common"); //”Common”是在前一步加入的XML对象名。
XmlDocument oDoc = new XmlDocument();
oDoc.LoadXml(oXml.XmlString);

XmlNode oE = oDoc.SelectSingleNode("Common/Form/Items");
//创建"Item"元素
XmlElement oEl = oDoc.CreateElement("Item");
//员工编号
oEl.SetAttribute("Code", this.drpEmployees.SelectedItem.Value);
//姓名
oEl.SetAttribute("Name", this.drpEmployees.SelectedItem.Text);
//补卡时间
DateTime time = DateTime.ParseExact(this.txtCheckDate.Text, "yyyy-MM-dd", null);
time = time.AddHours(int.Parse(this.txtCheckHour.Text));
time = time.AddMinutes(int.Parse(this.txtCheckMinute.Text));
oEl.SetAttribute("CheckTime", time.ToString("yyyy-MM-dd HH:mm"));
//原因
oEl.SetAttribute("Purpose", this.txtPurpose.Text);
//本月已补次数
oEl.SetAttribute("Times", this.txtTimes.Text);
//补卡类型
oEl.SetAttribute("CheckType", this.drpCheckType.SelectedItem.Text);

oE.AppendChild(oEl);


oXml.XmlString = oDoc.InnerXml;
oDoc = null;
//更新显示申请人列表
//this.LoadCheckItems();

3.显示列表数据:

XmlDocument oDoc = new XmlDocument();
oDoc.LoadXml(this.Process.GetXmlObject("Common").XmlString);
XmlNode nItems = oDoc.SelectSingleNode("Common/Form/Items");
string timesXml = nItems.OuterXml;
oDoc = null;

DataSet ds = new DataSet(“”);
Captaris.Workflow.Xml.DataSetXmlAdapter oA = new Captaris.Workflow.Xml.DataSetXmlAdapter(ds);
oA.ReadXml(xml);

//将数据集绑定到GridView

this.grdTimes.DataSource = ds;
this.grdTimes.DataBind();

4.移除一行:

private void RemoveCheckItem(int i)
{
    Teamplate.BLL.IModelXML oXml = this.Process.GetXmlObject("Common");
    XmlDocument oDoc = new XmlDocument();
    oDoc.LoadXml(oXml.XmlString);
    XmlNode nItems = oDoc.SelectSingleNode("Common/Form/Items");
    string timesXml = nItems.OuterXml;

    DataSet ds = new DataSet();
    Captaris.Workflow.Xml.DataSetXmlAdapter oA = new Captaris.Workflow.Xml.DataSetXmlAdapter(ds);
    oA.ReadXml(timesXml);

    if (ds.Tables.Count < 1)
    {
        ds = null;
        return;
    }

    ds.Tables[0].Rows[i].Delete();
    ds.Tables[0].AcceptChanges();
    //System.IO.StringWriter writer = new System.IO.StringWriter();
    //ds.Tables[0].WriteXml(writer);

    //nItems.InnerXml = writer.ToString();
    nItems.InnerXml = "";
    this.NewCheckItem(oDoc, ds.Tables[0]);
    oXml.XmlString = oDoc.OuterXml;
    //writer.Close();
    oDoc = null;
}

我觉得上面的代码太多了,为了节省您的脑细胞,我对XML操作封装成一个类,可以在此下载它。