workflow-foundation-4

Show an activity into the designer?

做~自己de王妃 提交于 2019-12-24 06:49:07
问题 I've a sample workflow application, which only have to display an activity an show on which step we are. The problem is that when I load my activity like this: TestWorkflow workflow = new TestWorkflow(); _workflowApplication= new WorkflowApplication(workflow ); _workflowDesigner = new WorkflowDesigner(); _workflowDesigner.Load(workflow ); uxGridWorkflowHoster.Children.Add(_workflowDesigner.View); I'm getting only the root element "sequence" in my box. how to change that? I get that on visual

Exception practices when creating a SynchronizationContext?

柔情痞子 提交于 2019-12-24 05:58:37
问题 I'm creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I'm wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used to Send (execute synchronously) or Post (execute asynchronously) delegates of type SendOrPostCallback . Although in both cases I invoke the delegate on a STA thread, its easy to know how to handle exceptions when executing synchronously. I block the calling thread, Invoke the callback on my worker

Dependency injection in custom workflow activity

為{幸葍}努か 提交于 2019-12-24 05:28:52
问题 I have a standard application that has a workflow. The customer can customize the workflow in the designer. Now we are making some custom activities for a specific customer. The custom activity is communicating against the business layer by a interface. How do I give the interface an implementation of that interface? It is very important that the standard application doesn't know about the interface and implementation of that interface because it is custom code for that specific customer. The

Managing ObjectContext in Workflow Foundation 4

我们两清 提交于 2019-12-24 00:48:11
问题 I'm working with Workflow Foundation 4 and Entity Framework 4.1. I am building my workflow with sets of ReceiveAndSendReply activities. It makes sense to me to use a single ObjectContext (or DbContext, now) per set of receive and send reply activities. How should I manage the ObjectContext? Are there activities just for this or do I need to manually manage it? 回答1: Its better not to use a DbContext or an ObjectContect directely in your worklfow. Put these in a workflow extension and let those

Windows Workflow Foundation 4 Create Base Activity

喜欢而已 提交于 2019-12-23 22:22:34
问题 In Windows Workflow Foundation 3.x, you used to be able to create a BaseWorkflow class where you could define some properties in that workflow. And then when you create a workflow you can say it derives from BaseWorkflow class so it inherits all the properties from the base workflow. Can we achieve the same thing in Windows Workflow Foundation 4 (WF 4)? Like defining InArgument and OutArgument on a BaseActivity then create another Activity that derives from the BaseActivity. I tried by modify

Parent activity type for NativeActivity activities

馋奶兔 提交于 2019-12-23 14:58:28
问题 Is there any way in which it can be seen the type of the parent activity of a NativeActivity from the Execute method ? 回答1: Yes, you can execute the following code block and it will return you the value of the internal Parent property -- this will be the instance of your parent. this.GetType() .GetProperty( "Parent", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance) .GetValue(this, null) 来源: https://stackoverflow.com/questions/5882680/parent-activity-type-for

Working with sub-workflow in rehosted designer?

房东的猫 提交于 2019-12-23 01:49:12
问题 Is it possible to work with a sub-workflow (i.e. subset of the workflow in the designer). For example a sequence, a flowchart, or any activity inside the workflow. My idea is something like these: Save the subworkflow to a file (for example, save the selected Sequence activity) Load a saved subworkflow and add it into current workflow Add a sub-workflow as an item in toolbox Are these even possible in WF4? 回答1: Sounds very much like your sub worklfows are just composite activities. Doing so

How to load runnable instances with multiply workflow definitions from Instance Store when server restart

一世执手 提交于 2019-12-22 17:53:21
问题 I'm evaluating Workflow Foundation 4 or 4.5, and want to know how to load runnable instances with multiply workflow definitions from instance store when server restart? It's same question as the forum topic: http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/b8d5ed34-054a-4e55-88e1-cd430ac42110?prof=required "When using the InstanceStore.WaitForEvents, the HasRunnableWorkflowEvent event is raised if any instance is ready. And, to call the WorkflowApplication

How do you hook an editor for TFS 2010 WF BuildProcessTemplate arguments for built-in types that have a converter?

一世执手 提交于 2019-12-22 12:34:24
问题 I've followed the Team Foundation Server 2010 book's custom editor for a dictionary<string,string> and can't get it to go. I have another custom editor in the same assembly, and consumed by the same build template that works. This SO hints at it being a TypeConverter issue, but I don't think any part of a custom build assembly is just run when it is loaded. I'm getting the default generic Collection Editor instead of mine. I have tried using code more like my credential UITypeEditor uses, and

VS Workflow designer not expanding activities

半腔热情 提交于 2019-12-22 11:27:22
问题 I can't figure out why some activities in the WF designer do not expand. Looking at the sample documentation for the WizardActivityPack activities: But when I try to open the same file in Visual Studio 2010's WF designer: If I look at the file using the XML editor I can see all the activities are in the file, but the designer only shows me the one box and I cannot click into or expand it. 回答1: You have to place the *.design.dll somewhere that visual studio can find it. Like in the