WF中的持久化服务

2008-07-03 10:39:57.0     推荐:0    收藏:0    评论:0     来源: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页]   [下一页]
您可以针对本文进行:[评论]  [收藏]  [推荐]  
  • 共有0条评论  点击查看更多评论
  • 网友评论仅供网友表达个人看法,并不表明e800同意其观点或证实其描述
我想发表评论:
用户名密码
  • 匿名发表
    验证码: