workflow-foundation-4

True concurrency on a collection in Windows WF 4.5

别说谁变了你拦得住时间么 提交于 2019-12-13 02:23:35
问题 I am modifying an existing Windows Workflow Foundation project that was previous coded to run everything synchronously. However, as the data set grew this needed to change to meet performance requirements. What I have: Inside the workflow I have a parent Sequence Workflow that contains a few elementary workflows that basically set a few services up and prepares them to run. I then have the bulk of the workflow's work , which consists of a ForEach Workflow that operates on a collection of

While activity in WF 4 rehosted designer

时光怂恿深爱的人放手 提交于 2019-12-13 01:16:15
问题 I have written a custom activity which contains a simple ExpressionTextBox: <sapv:ExpressionTextBox HintText="List of Strings" Grid.Row ="0" Grid.Column="1" MaxWidth="150" MinWidth="150" Margin="5" OwnerActivity="{Binding Path=ModelItem}" Expression="{Binding Path=ModelItem.Test, Mode=TwoWay, Converter={StaticResource ArgumentToExpressionConverter}, ConverterParameter=In }" /> In the library, i've added Test property as follows: public InArgument<string> Test { get; set; } So, this is the

How to mandate workflows to include local types assembly name?

懵懂的女人 提交于 2019-12-13 00:58:52
问题 I am using WF4 and am having my types, activities and workflows in the same project and then I am using ActivityXamlServices.Load(path) to load my workflow activity and it throws the following exception: The type ‘InArgument(local:,,,, of property ‘InputArgs’ could not be resolved By looking at the solution to this problem at this post, I included assembly name manually in the workflow, and it all works. Problem: Everytime I make any change in the workflow, it re-writes the xaml and removes

Execute single workflow instance in parallel

北慕城南 提交于 2019-12-12 17:24:27
问题 Let's say I have a workflow, and I want to execute it many times in parallel: System.Threading.Tasks.Parallel.For( 0, 100, i => WorkflowInvoker.Invoke( new Workflow1(), new Dictionary<string, object> { { "Num", i } })); I wonder, is it legal to execute it this way: var w = new Workflow1(); System.Threading.Tasks.Parallel.For( 0, 100, i => WorkflowInvoker.Invoke( w, new Dictionary<string, object> { { "Num", i } })); 回答1: Yes it is "legal" to execute a workflow definition that way. The workflow

Creating custom activity design without reference to Design DLL in Windows Workflow Foundation

[亡魂溺海] 提交于 2019-12-12 17:23:22
问题 I am using Windows Workflow Foundation with custom Activities , and I would like to create custom Design for these activities in my workflow. I am able to make the design project, and the designer xaml. Also I am able to see the custom design for them in the workflow, if I directly refer the Design project in my Workflow project . This is something that I would not like to do, because the Designer DLL should not be deployed to production environment. I would only like to have the custom

VisualBasicValue<T>: Access custom classes and its methods\properties

我的梦境 提交于 2019-12-12 06:32:59
问题 Suppose I've a custom class (any class), with its methods and properties: public class Test { public string MyString { get; set; } public bool MyBool { get; set; } public override string ToString() { return "Test Class : " + this.MyString + " - " + MyBool; } } Now I want to move and handle its properties between WF4 activities using VisualBasicValue<T> . For example: public class Program { static void Main(string[] args) { Test testClass = new Test() { MyString = "some string", MyBool = true

How can I access the workflow ID in BeginOnSave / PersistenceIOParticipant?

試著忘記壹切 提交于 2019-12-12 05:49:23
问题 I'm using PersistenceIOParticipant to write the workflow status to a custom db table. I need the workflow ID - any ideas how I can access it from within BeginOnSave? 回答1: As far as I know the only way is to retreive it in a activity from the execution context and pass that to your service. 来源: https://stackoverflow.com/questions/11051774/how-can-i-access-the-workflow-id-in-beginonsave-persistenceioparticipant

How to solve unknow type problem when load a Xmal file

醉酒当歌 提交于 2019-12-12 05:24:45
问题 I am facing this error, "Cannot create unknown Type '{clr- namespace:ActivityLibrary1;assembly=ActivityLibrary1}MyActivity1'" while trying to load a worklfow from Xaml file. I am trying to load Xaml from a class library project. ActivityLibrary1 is library that contains custom activity. I tried to resolve assembly at runtime by handling the currentDomain.AssemblyResolve += new ResolveEventHandler(MyResolveEventHandler) event. The assembly which it is unable to find is System.Xaml.Resources.

How to conditionally use InvokeMethod in an XAML Windows workflow foundation

自作多情 提交于 2019-12-12 04:32:02
问题 In windows workflow foundation sequence workflow, How to use invoke method tags to be invoked based on certain condition? For example, <Sequence> <Sequence.Variables> <Variable x:TypeArguments="x:String" Default="["this is an out param"]" Name="outParam" /> <Variable x:TypeArguments="x:Int32" Name="resultValue" /> <Variable x:TypeArguments="msi:TestClass" Default="[New TestClass()]" Name="varTestClass" /> </Sequence.Variables> <sap:WorkflowViewStateService.ViewState> <scg:Dictionary x

WF: Workflow Designer: List of InArgument added dynamically : How to get value during workflow execution

前提是你 提交于 2019-12-12 03:07:16
问题 I have built a workflow designer that allows to enter a list of email addresses.Each email in the list needs to be an InArgument(Of String) so they can be individually edited/added using variables. On my Activity, I have a property that is declared like so: Public Property [To] As ObservableCollection(Of InArgument(Of String)) My designer is wired up and populating this collection properly. However during the execution, I do not know how to get the run-time value for each InArgument that was