workflow-foundation

Update EntityKey Reference in Entity Framework

那年仲夏 提交于 2019-12-10 18:49:14
问题 I created an application that uses Asp.net, Entity Framework and Windows Workflow Foundation and everything works as expected. My asp.net page should start a Workflow that executes and update an entity passed to the workflow from the page. Everything works ok: i used Unit Of Work pattern to share the context between asp.net and WWF and my entity is successfully updated during the workflow... except a field that is modelled in my entity as a reference to another entity. Suppose this case. The

Windows Workflow Foundation in ASP.NET 3.5 Web Application - Best Approach

这一生的挚爱 提交于 2019-12-10 18:05:15
问题 What is the best way to use Windows Workflow Foundation in ASP.NET 3.5 Web Application. In my case there are several workflows(sequential) which includes numerous steps, user has the privilege to save and exit at any of these steps; the state must be persisted, possibly in SQL Server. Exposing workflows as web service is good idea? I have very little idea about workflows and only tried out wf console applications. Please guide me in right direction, also I would like to know is there any

RowStyleSelector Not Called

前提是你 提交于 2019-12-10 15:30:06
问题 I'm having difficulty getting a RowStyleSelector to work with a WPF DataGrid. In my resources, I have <loc:DetailsRowStyleSelector x:Key="detailsRowStyleSelector" AddRowStyle="{StaticResource newItemRowStyle}" StandardRowStyle="{StaticResource RowStyle}"/> Then my datagrid uses this like so: <DataGrid ... EnableRowVirtualization="false" VirtualizingStackPanel.VirtualizationMode="Standard" RowStyleSelector="{StaticResource detailsRowStyleSelector}" The constructor for the selector is called,

How to write a long running activity to call web services in WF 4.0

蹲街弑〆低调 提交于 2019-12-10 11:31:31
问题 I created an activity which executes a web request and stores the result into the database. I found out that for these long running activities I should write some different code so that the workflow engine thread won't be blocked. public sealed class WebSaveActivity : NativeActivity { protected override void Execute(NativeActivityContext context) { GetAndSave(); // This takes 1 hour to accomplish. } } How should I rewrite this activity to meet the requirements for a long running activity 回答1:

Registering custom tracking participants through code in workflow foundation 4.0

…衆ロ難τιáo~ 提交于 2019-12-10 11:21:28
问题 I'm having trouble trying to attach a custom tracking participant in workflow foundation 4.0. I have a class that inherits from TrackingParticipant but I cannot see any other way of attaching it to my WorkflowServiceHost other than through lots of messy app.config entries like the SDK example demonstrates below (in the system.servicemodel element). This option seems to require a lot of extra overhead and classes to be created, when I just want a simple custom tracking participant to listen to

Tracing in WF4 doesn't work?

主宰稳场 提交于 2019-12-10 11:11:17
问题 I'm trying to set up a simple test case of pushing to a TraceListener in WF4. I've created an empty wcf service library app (just the default get/reply xamlx) and added the below to the config. I get no logging back. Is there something else required? <system.diagnostics> <sources> <source name="System.Workflow"> <listeners> <add name="System.Workflow" /> </listeners> </source> <source name="System.Workflow.Runtime"> <listeners> <add name="System.Workflow" /> </listeners> </source> <source

WF4.5 Dynamic Update - Issues when updating large, long-running flows with custom activities

放肆的年华 提交于 2019-12-10 10:46:03
问题 I am working on implementing an update process for our large workflows that have the potential to last years, even decades. I'm picking up where previous developers have left off, and, after spending a week trying to get the existing code (based mostly off of Microsoft's provided example) to work, I've scrapped it and built my own WorkflowVersioning utility. While I've been able to successfully update persisted instances to new versions, in testing I've found that various changes can cause

Setting internal properties in composite WF4 Activities at design time

扶醉桌前 提交于 2019-12-10 09:56:30
问题 I want to create a composite Windows Workflow Activity (under .NET 4) that contains a predefined ReceiveAndSendReply Activity. Some of the properties are predefined, but others (particularly ServiceContractName) need to be set in the designer. I could implement this as an Activity Template (the same way ReceiveAndSendReply is implemented), but would rather not. If I later change the template, I'd have to update all previously created workflows manually. A template would also permit other

When do you favor the use of state machines over linear workflows

可紊 提交于 2019-12-10 07:17:33
问题 State machines can reduce complexity of workflows when there are multiple loops and branching or logic when the workflow must "react" to answers supplied by users. This would be an event-driven workflow. In what circumstances have you elected to use a state machine and what type of pain did reduce in terms of time and complexity? 回答1: State machines are really nice for event-driven code. You can't use loops and branches if your code is being invoked as a response to some event. You'll have to

Pattern for long running tasks invoked through ASP.NET

谁说我不能喝 提交于 2019-12-10 06:06:29
问题 I need to invoke a long running task from an ASP.NET page, and allow the user to view the tasks progress as it executes. In my current case I want to import data from a series of data files into a database, but this involves a fair amount of processing. I would like the user to see how far through the files the task is, and any problems encountered along the way. Due to limited processing resources I would like to queue the requests for this service. I have recently looked at Windows Workflow