当前位置:IT168首页 > 技术开发 > 概述
[收藏此页] [打印] [推荐] [评论]

WF中的持久化服务

责任编辑:nancy作者:ITPUB论坛   2008-07-03   
【内容导航】
文本Tag: 微软 sql

【IT168技术文档】

  创建好的持久化数据库里包含两张表, InstanceState和 CompletedScope,InstanceState表中记录未完成事例的运行状态,CompletedScope表记录当工做流使用事务的支持。

  定义两个事件
首先定义IPersistenceDemo接口: [ExternalDataExchange] public interface IPersistenceDemo { event EventHandler<ExternalDataEventArgs> ContinueReceived; event EventHandler<ExternalDataEventArgs> StopReceived; } 实现本地服务PersistenceDemoService: public class PersistenceDemoService : IPersistenceDemo { public event EventHandler<ExternalDataEventArgs> ContinueReceived; public event EventHandler<ExternalDataEventArgs> StopReceived; public void OnContinueReceived(ExternalDataEventArgs args) { if (ContinueReceived != null) { ContinueReceived(null, args); } } public void OnStopReceived(ExternalDataEventArgs args) { if (StopReceived != null) { StopReceived(null, args); } } }
  whileActivity的条件为!this.IsComplete

  heeContinue和heeStop分别接收我们定义的ContinueReceived和StopReceived事件。
public sealed partial class PersistenceDemoWorkflow: SequentialWorkflowActivity { private Boolean isComplete = false; public Boolean IsComplete { get { return isComplete; } set { isComplete = value; } } public PersistenceDemoWorkflow() { InitializeComponent(); } private void handleStopReceived_Invoked(object sender, ExternalDataEventArgs e) { //tell the WhileActivity to stop isComplete = true; } }
上一页
1
2下一页
收藏到: 添加到“百度搜藏”添加到“QQ书签”添加到“Google书签”添加到“Yahoo收藏”添加到“和讯网摘”
【内容导航】
本文欢迎转载,转载请注明:转载自IT168 [ http://www.it168.com/ ]
本文链接:http://tech.it168.com/d/2008-07-03/200807031004808.shtml
技术开发相关文章  
  • 暂无
友情推介