workflow-foundation-4

Implementing AsyncCodeActivities (using C# async/await)

核能气质少年 提交于 2019-11-30 14:12:34
问题 Since long time I'm writing custom AsyncCodeActivity classes using the following template: public sealed class MyActivity : AsyncCodeActivity<T> { protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state) { var task = new Task<T>(this.Execute, state, CancellationToken.None, TaskCreationOptions.AttachedToParent); task.ContinueWith(s => callback(s)); task.Start(); return task; } protected override T EndExecute(AsyncCodeActivityContext

Dependency injection / IoC in Workflow Foundation 4

别说谁变了你拦得住时间么 提交于 2019-11-30 13:50:56
问题 Is it possible to use DI in your workflow activities? and if yes, how? For example if you have an activity like public sealed class MyActivity : CodeActivity { public MyClass Dependency { get; set; } protected override void Execute(CodeActivityContext context) { Dependency.DoSomething(); } } how can i set Dependency ? (I'm using Spring.Net) 回答1: Workflow doesn't use an IOC container. It uses the ServiceLocator pattern where you add dependencies to the workflow runtime as extensions and

WF4 RC - Cannot create unknown type when loading WF Service from loose Xaml with ActivityXamlServices

倾然丶 夕夏残阳落幕 提交于 2019-11-30 13:41:17
I am trying to host a WF4 (RC) Service dynamically. I have a test solution with two projects. The first is a declarative workflow service library with one root Flowchart activity in it, and a simple custom code activity. The workflow service library does not depend on any other custom assemblies or references. The second is my host app, which in my test solution is just a console application. In my host app, I am attempting to the use ActivityXamlServices to load the Xaml for the workflow service into an activity, and then use the WorkflowServiceHost to fire up a workflow instance using that

To Workflow or Not to Workflow?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 10:04:36
问题 I am responsible for a team of developers who will are about to start development of a light weight insurance claims system. The system involves a lot of manual tasks and business workflows and we are looking at using Windows Workflow (.NET 4.0). An example of the business domain is as follows: A policy holder calls the contact centre to lodge a claim. This “event” fires two sub tasks which are manually actioned in parallel and may take a lengthy time to complete; Check customer for fraud – A

Dependency injection / IoC in Workflow Foundation 4

和自甴很熟 提交于 2019-11-30 08:37:38
Is it possible to use DI in your workflow activities? and if yes, how? For example if you have an activity like public sealed class MyActivity : CodeActivity { public MyClass Dependency { get; set; } protected override void Execute(CodeActivityContext context) { Dependency.DoSomething(); } } how can i set Dependency ? (I'm using Spring.Net) Workflow doesn't use an IOC container. It uses the ServiceLocator pattern where you add dependencies to the workflow runtime as extensions and workflow activities and retrieve these services from the workflow extensions through the context. A ServiceLocator

User Defined Dynamic Workflows in Workflow Foundation 4?

落爺英雄遲暮 提交于 2019-11-30 07:29:21
I have been, exhaustively, looking at examples of WF4 and am not sure it will work for my project . I need to be convinced otherwise. I am struggling with how we would implement a system to use WF4 so users have the ability to define workflows. It seems you need VS2010 experience to design and implement a WF4 workflow. I love wheat it can offer, but feel it may be too complicated for non techical users. Do we just define a ton of custom activies that a user can move into a workflow? How can we make it as easy as possible for a user to build the workflow? We have and application that we want to

CRM 2011 Workflows: Finding the previous values

本秂侑毒 提交于 2019-11-30 05:31:22
问题 I currently have a workflow which is triggered when a certain decimal field is changed. Is it possible to get the difference between the old and new values via a workflow? 回答1: Finally had the time to test this, and it is perfectly possible to retrieve the pre values in a workflow using a workflow assembly. Here's what I did: I created a workflow on Contact, with a trigger on LastName. The workflow contains a reference to the field lastname, and a custom workflow assembly . I opened a contact

Binding data to Combobox in custom activity designer

廉价感情. 提交于 2019-11-30 03:18:54
问题 I have a custom activity, with a single in argument which is a string. However, rather than allow the designer to enter an arbitrary string, I want the designer to be presented with a Combobox with the list of options, the options are dynamic and are loaded from a database into a List<> collection. My problem is I have no clue how to bind the Combobox in the designer to this list and have the selection set to the in argument of the activity. Visually I have the activity designer working, it

Windows workflow 4 : difference between WorkflowApplication Cancel, Terminate and Abort

我们两清 提交于 2019-11-30 01:43:11
Can any one explain what the difference is between the following methods of WorkflowApplication: Abort Cancel Terminate After further investigating this issue, I want to summarize the differences: Terminate : the Completed event of the workflow application will be triggered the CompletionState (WorkflowApplicationCompletedEventArgs) is Faulted the Unloaded event of the workflow application will be triggered the workflow completes OnBodyCompleted on the activity will be called Cancel: the Completed event of the workflow application will be triggered the CompletionState

WF4 RC - Cannot create unknown type when loading WF Service from loose Xaml with ActivityXamlServices

被刻印的时光 ゝ 提交于 2019-11-29 18:59:25
问题 I am trying to host a WF4 (RC) Service dynamically. I have a test solution with two projects. The first is a declarative workflow service library with one root Flowchart activity in it, and a simple custom code activity. The workflow service library does not depend on any other custom assemblies or references. The second is my host app, which in my test solution is just a console application. In my host app, I am attempting to the use ActivityXamlServices to load the Xaml for the workflow