随笔分类 -  WF4

摘要:Designer:<sap:ActivityDesigner x:Class="CompositeActivity.CompositeDesigner" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sap="clr-namespace:System.Activities.Presentation;assembly 阅读全文
posted @ 2012-07-02 12:19 Leo Tang 阅读(524) 评论(0) 推荐(0)
摘要:Generally, we add a service reference(generate client activity in a workflow project) or generate proxy class then call it in a custom activity to call a WCF service from a workflow.If we try to call the service directly via message activity, we need to wrap the input and output of the service opera 阅读全文
posted @ 2012-06-25 18:11 Leo Tang 阅读(209) 评论(0) 推荐(0)
摘要:Scenario:OP has alist of complied workflow types, which is created by using reflection to find all types. var assembly = Assembly.GetAssembly(this.GetType()); foreach (Type objType in assembly.GetTypes()) { if (objType.IsSubclassOf(typeof(Activity))) ... 阅读全文
posted @ 2012-06-22 11:28 Leo Tang 阅读(371) 评论(0) 推荐(0)
摘要:If we wan't to manually control the worlflow instance, we can use the new contract called IWorkflowInstanceManagementintroduced in .Net Framework4.0. This contract defines a series of control operations that allow you remotely control workflow instances hosted by WorkflowServiceHost. WorkflowCon 阅读全文
posted @ 2012-06-21 17:00 Leo Tang 阅读(662) 评论(4) 推荐(0)
摘要:在WF中创建一个异步执行的activity,可以直接继承抽象类AsyncCodeActivity或者在NativeActivity使用bookmark实现。AsyncCodeActivity:protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state)protected override void EndExecute(AsyncCodeActivityContext context, IAsyncResult result 阅读全文
posted @ 2012-06-04 16:09 Leo Tang 阅读(574) 评论(0) 推荐(0)
摘要:在ASP.NET同步调用workflow或service是比较简单的,直接用workflowInvoker或workflowApplication运行workflow,用生成的代理类调用service中的方法。异步调用则首先需要在页面指令中添加:然后service可以在添加引用的时候,指定创建异步调用的方法(WCF实现异步执行的方法是另一个话题,这里指的客户端异步的去调用)。 var proxy = new TestServiceClient(); proxy.DoWorkCompleted += (o, args) => ... 阅读全文
posted @ 2012-05-31 16:11 Leo Tang 阅读(443) 评论(0) 推荐(0)
摘要:Workflow 通过Message activity把内部的方法以WCF的形式暴露出去。一直的理解是相应的每个message activity的endpoint, service contract, operation contract以须是惟一的。http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/b4b5ca27-ef97-4f37-9eac-ff2e9645c615直到这个贴子的出现,貌似多个message activity具有相同的endpoint,service contract, operation 阅读全文
posted @ 2012-05-30 16:39 Leo Tang 阅读(179) 评论(0) 推荐(0)
摘要:Workflow一般是长时间运行,在需要等待用户输入或者执行异步操作的时候,worflow引擎可以对当前实例进行持久化,也就是把内存中的实例序列化,然后存在一些永久介质上,比如文件系统或数据库中。如果这个时候workflow的定义发生了改变,那么将已经持久化了的实例反序列化、重新载入host程序运行时便会出现问题。WF4以前一般就是依靠.Net本身的程序集版本控制机制,让不同版本的实例加载不同版本的定义。WF4由于持久化进没有把所有的workflow定义一起序列化,所以一些特定的修改还是可以把旧的实例能过新的定义重新载入。WF4.5提供了一个动态更新的功能。WF3:Versioning Wor 阅读全文
posted @ 2012-05-25 15:47 Leo Tang 阅读(310) 评论(0) 推荐(0)
摘要:Enterprise library里面的Validation Application Block提供了对WCF集成支持,但是基于WCF的Workflow Service不支持Integrating the Validation Application Blockhttp://msdn.microsoft.com/en-us/library/ff650801通过配置的方式,validate WCF: ... 阅读全文
posted @ 2012-05-25 10:48 Leo Tang 阅读(165) 评论(0) 推荐(0)
摘要:最近碰到一个用netTcpContextBinding host workflow service 的问题。一直碰到远程主机强制关闭连接的问题,问题出在没有publish metadata。一般情况下会添加一个endpoint来publish metadata:但是workflow service没有实现IMetadataExchange contract, 所以没法通过这种方式publish metadata。后来做WCF的同事给了一个办法通过http的方式来publish metadata,相关的配置如下:app.config: ... 阅读全文
posted @ 2012-05-09 11:08 Leo Tang 阅读(971) 评论(0) 推荐(0)